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

Re: [Libevent-users] Is evthread_use_pthreads required for isolated evdns event_bases?



On Fri, May 3, 2013 at 9:41 AM, Joseph Spadavecchia <joseph@xxxxxxxxxxx> wrote:
 [...]
> Is this a bug or is evthread_use_pthreads() required for multiple --
> isolated -- threads to use evdns?

Under the current architecture, you do indeed need to initialize
threading for any resource to be shared across threads, which *does*
include the PRNG.  Unfortunately, evdns does not currently have an
option like EVENT_BASE_FLAG_NOLOCK, so once threading is initialized,
every evdns_base is going to have a lock that it doesn't need.

I'd be open to work to change this, including by:
  * Letting the PRNG be thread-specific.
  * Adding an option to make the PRNG be evdns_base-specific
  * Adding a flag like EVENT_BASE_FLAG_NOLOCK for evdns_base initialization.

Other thoughts?

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