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

Re: [Libevent-users] Help with progress thread



On Nov 9, 2010, at 9:57 PM, Nick Mathewson wrote:

> On Tue, Nov 9, 2010 at 11:47 PM, Ralph Castain <rhc@xxxxxxxxxxxx> wrote:
>> 
>> On Nov 9, 2010, at 9:03 PM, Nick Mathewson wrote:
> [...]
>>> So I'm assuming that you've got all the threading callbacks set up
>>> (probably via evthread_use_pthreads()) before you created the event
>>> base, so that evthread_make_base_notifiable() was called on the
>>> event_base when you created it.  If that's not the case, that's
>>> probably the problem there.
>> 
>> I missed that - this may well be my problem. Let me dig into this a little and get back to you.
>> 
>> FWIW: I don't see myself drop out of the event loop when I add the event. In fact, just the opposite - I'm stuck in the loop and can't get out. So I'm not sure the bug mentioned below is accurate.
>> 
>> Let me see what happens when I setup the event base for notification.
> 
> To clarify, it should set itself up to be notifiable if you have
> threading initialized before you create it.  (If you're going to
> access an event_base from multiple threads, you MUST initialize
> threading, or else there won't be any locks, and you'll be in a world
> of race conditions.)
> 
> Then again, calling evthread_make_base_notifiable() on an existing
> event_base shouldn't hurt, since it's (supposed to be) idempotent.

I'm confused - the function you cite requires an event base be passed to it:

int evthread_make_base_notifiable(struct event_base *base);

So how can I call it -before- I create the event base?


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

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