[Libevent-users] deadlock in version 2.0.5

2010-08-11 Thread Avi Bab
The scenario – Thread B tries to delete an event E for which a callback is executed by thread A. The callback calls event_base_gettimeofday_cached() that acquires th_base_lock: Thread A (LWP 14625 in the stack/strace below) locks *current_event_lock* before invokoing callback. Thread B (LWP

Re: [Libevent-users] To upgrade or not to upgrade - that is the question

2010-08-11 Thread Nick Mathewson
On Wed, Aug 11, 2010 at 1:21 AM, Gilad Benjamini wrote: > Nick, > Thanks for the answer and the detailed document. > Out of the different open source projects out there using libevent, which > ones have already moved to 2.0 ? Tor supports some but not all of the new 2.0 stuff, and will move to us

Re: [Libevent-users] Crash in event_del

2010-08-11 Thread Dan Kegel
On Wed, Aug 11, 2010 at 12:22 PM, William Ahern wrote: >> This code sample does skip the mandatory event_init, but event_del should be >> more cautious nevertheless. > > Why? You'd rather the code do an admittedly needless check millions, > possibly billions of times per process? I suppose when c

Re: [Libevent-users] Crash in event_del

2010-08-11 Thread William Ahern
On Wed, Aug 11, 2010 at 12:00:09PM -0700, Gilad Benjamini wrote: > My code currently runs with libevent 1.4 > While in the process of upgrading to libevent 2.0.6 I got a segfault. > > Code sample is pretty basic > event_set(&ev,fd,EV_READ,fd_handler,NULL) ; > event_del(&ev) ; > > The reason f

Re: [Libevent-users] To upgrade or not to upgrade - that is the question

2010-08-11 Thread Thor Lancelot Simon
On Tue, Aug 10, 2010 at 04:27:47PM -0700, Gilad Benjamini wrote: > > What are the major benefits of 2.0 ? >From my point of view, a lot of convenience code was added which many large programs already written to the libevent 1.4 APIs would already have, some APIs were cleaned up, and the library w

[Libevent-users] Crash in event_del

2010-08-11 Thread Gilad Benjamini
My code currently runs with libevent 1.4 While in the process of upgrading to libevent 2.0.6 I got a segfault. Code sample is pretty basic event_set(&ev,fd,EV_READ,fd_handler,NULL) ; event_del(&ev) ; The reason for the crash is pretty simple as well. event_del calls EVBASE_ACQUIRE_LOCK which