[EMAIL PROTECTED] wrote:
Greetings,
I've been using libevent for a project for its socket polling
abstraction features (mostly for the graceful scalability). I'm a big
fan so far of what I've been able to do with it. My question, however,
is regarding the signal_* functions and how they work exactly. My
understanding is that they basically setup their own signal handlers
and call your callback function when the specified signal(s) are
received. My question is this:
I'm reading that if I return -1 from my callback function, that will
cause event_dispatch() to abort. I want it to do this. However, I do
need to clarify something. Will any callbacks that event_dispatch()
happens to be running at the moment I return -1 continue to run to
completion? I need to make sure that my callbacks finish executing
before I do what I want to do here . .
I haven't verified this with the code, but from my history of using
signals, I will say no they wont, but... I suspect they won't be in the
middle of doing anything either as your still running serially, that is
unless your using bufferevents, or something that holds data over
multiple events. In that case, you'll need to make the 'signal
callback' set some kind of global shutdown flag, to simulate a
pthread_cond_broadcast().
-Phil.
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users