[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Re: Proposal for libevent-2 to provide functions to hide event structure details



On Friday 15 January 2010 12:22:47 Dan Kegel wrote:
> On Fri, Jan 15, 2010 at 2:48 AM, Pavel Pisa <ppisa4lists@xxxxxxxxxx> wrote:
> > please, consider addition of functions to allow access more fields
> > of struct event a way ensuring compatibility with future libevent
> > version. ...
> > The rationale:
> >  - hide event structure implementation/layout. Application using these
> > functions instead of direct access can keep compatibility with future
> > libevent versions.
>
> +1
>
> I for one would love to see libevent have a stable ABI, and that means no
> more public structs.   (I had hoped they'd be gone with 2.0.)
> - Dan

Hello Dan,

thanks for vote.

As for libevent 2.0, it is possible to use it without need to access
structure directly. But it has drawback, that you cannot allocate
structure first, then provide it to other functional modules of application
which fill FD and callback and call add operation.
ulevpoll paradigm is little different and to keep it, I would have
to add fields to store information in my structure and then create
libevent event when ulevpoll trigger is arm first time. Which would
mean malloc at trigger time and double indirection from user trigger
handle to libevent structure.

To you specially, I value your opinion much, so I would be very interrested
to hear your opinion about ulevpoll library unified ABI.
Unfortunately it does not map well to libevent1, at least older (Debian)
version has problems which leads to memory use after free or force ulevpoll
to not call free in ul_evplibevent1_trig_done. It seems to be some
problem with calling event_del from corresponding callback in that
version of libevent1. Or I have some other bug in my code for this case.
But support for libevent-2 seems to be stable and I have found no leakage
or bad memory use for by Valgrind in ul_evpchk. Glib support should be
OK too. Self made poll, select and epoll support as well.
Missing is BSD kevent and Windows support (except simple select).

Thanks much

                Pavel
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.