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

Re: [Libevent-users] workers for evhttp (was stable, now not!)



On Fri, May 20, 2011 at 11:26 PM, Michael Herf <herf@xxxxxxxxx> wrote:
 [...]
> Questions: is bufferevent supposed threadsafe for this case? I suppose I
> haven't verified if my technique of handing evhttp_request over the thread
> boundary is supposed to work or not...it has just been working for quite a
> long time under earlier versions of libevent.

Bufferevents are supposed to be threadsafe if you construct them with
the BEV_OPT_THREADSAFE option, but evhttp isn't threadsafe in 2.0.
(Specifically, you can use separate evhttp bases and connections in
different threads, but you can't be accessing the same one in more
than one thread at once.)  I would love a threadsafe evhttp in 2.1 if
somebody wants to work on that.

No idea why this would happen more in 2.0.10-stable than in 2.0.8-rc;
There were some bugs fixed in 2.0.9-rc and 2.0.10-stable that might
make the main thread more aggressive about running events as needed,
or about scheduling events more quickly, thus making races more
frequent in practice, but I'm just guessing there.

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