[Libevent-users] Mixing edge-triggered and level-triggered events

2012-07-02 Thread Avi Bab
I am using libevent-2.0.18-stable running on Linux (CentOs 6.2) to implement an HTTP proxy. For each connection I define: (i) an edge-triggered read event and (ii) a socket-based bufferevent with EV_WRITE enabled and EV_READ disabled. Using strace I see that adding the first event calls: epoll_

[Libevent-users] Assertion fails in insert_common_timeout_inorder

2012-06-24 Thread Avi Bab
I am using libevent-2.0.18-stable running on Liux (CentOs 6.2). Adding an event with a common timeout I get an assertion failure in insert_common_timeout_inorder (event.c:2532): "EVUTIL_ASSERT(is_same_common_timeout(&e->ev_timeout, &ev->ev_timeout));" This happens once every few days on a libev

[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

[Libevent-users] lock question

2010-07-29 Thread Avi Bab
Does writing to an output evbuffer (specifocally I use evbuffer_add_reference) of a bufferevent attempt to acquire the event_base's lock? I.e., if thread A calls evbuffer_add_reference(bufferevent_get_output(bev), data, data_len, cleanupfn, extra) - will it block while thread B that dispatches

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-05 Thread Avi Bab
Behalf Of Nick Mathewson Sent: Monday, July 05, 2010 8:05 PM To: libevent-us...@freehaven.net Subject: Re: [Libevent-users] deadlock in libevent-2.0.5-beta On Mon, Jul 5, 2010 at 3:03 AM, Avi Bab wrote: > > I now have a clearer view of things. > Like Zhou said - there is a thread adding an

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-05 Thread Avi Bab
l Message- From: owner-libevent-us...@freehaven.net [mailto:owner-libevent-us...@freehaven.net] On Behalf Of Nick Mathewson Sent: Sunday, July 04, 2010 4:54 PM To: libevent-us...@freehaven.net Subject: Re: [Libevent-users] deadlock in libevent-2.0.5-beta On Sun, Jul 4, 2010 at 4:29 AM, Avi Bab wrote: >

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Avi Bab
Apologies - this seems to be incorrect From: owner-libevent-us...@freehaven.net [mailto:owner-libevent-us...@freehaven.net] On Behalf Of Avi Bab Sent: Sunday, July 04, 2010 2:04 PM To: libevent-us...@freehaven.net Subject: RE: [Libevent-users] deadlock in libevent-2.0.5-beta Prior to this

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Avi Bab
...@freehaven.net [mailto:owner-libevent-us...@freehaven.net] On Behalf Of Avi Bab Sent: Sunday, July 04, 2010 1:41 PM To: libevent-us...@freehaven.net Subject: RE: [Libevent-users] deadlock in libevent-2.0.5-beta This made a great improvement - the deadlock still appears but only on even higher loads

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Avi Bab
on mailto:ni...@freehaven.net>> wrote: On Thu, Jul 1, 2010 at 6:44 AM, Avi Bab mailto:a...@breach.com>> wrote: > > > Running on Linux with pthreads. > > > > One thread (CBTcpProxyListenerThread below) adds bufferevents (with option > BEV_OPT_THREADSAFE) to an event_

RE: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Avi Bab
libevent-2.0.5-beta On Thu, Jul 1, 2010 at 6:44 AM, Avi Bab wrote: > > > Running on Linux with pthreads. > > > > One thread (CBTcpProxyListenerThread below) adds bufferevents (with option > BEV_OPT_THREADSAFE) to an event_base. > > A second thread (CBTcpProxySenderThre

[Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-01 Thread Avi Bab
Running on Linux with pthreads. One thread (CBTcpProxyListenerThread below) adds bufferevents (with option BEV_OPT_THREADSAFE) to an event_base. A second thread (CBTcpProxySenderThread) dispatches on the event_base. bufferevents are removed from the event_base either by a third thread or by the

RE: [Libevent-users] Thread safety with Evbuffers and Bufferevents

2010-06-22 Thread Avi Bab
On Sun, Jun 20, 2010 at 5:51 AM, Avi Bab wrote: > Hello all, > > > > I'd like to use a socket based bufferevent to perform asynchronous writing > to the underlying socket: > > One thread, X, adds data to the output  evbuffer (either by > evbuffer_reserve_sp

[Libevent-users] Thread safety with Evbuffers and Bufferevents

2010-06-20 Thread Avi Bab
Hello all, I'd like to use a socket based bufferevent to perform asynchronous writing to the underlying socket: One thread, X, adds data to the output evbuffer (either by evbuffer_reserve_space+ evbuffer_commit_space or by evbuffer_add_reference) and another thread, Y, dispatches on the buffer

[Libevent-users] setting bufferevent without heap-allocation

2010-06-16 Thread Avi Bab
Hi All, Is there an option to set up a bufferevent without heap-allocation (something like event_assign() for events) ? Thanks, Avi