Here's a quick synopsis for those who don't want to read the whole
explanation :) Is it possible to create events in threads that will
fire in the main thread if the access to event_set is mutually
exclusive?

Longer explanation:
After I already implemented a multithreaded server based on libevent,
I saw Steven's message about the threading support. I basically have
one thread which does all the I/O, two other types of threads.

The first handles all the accepts and sends a welcome message to each
new thread (using libevent if the call to write() doesn't write all
the bytes). The second is actually a group of threads which are in
charge of authenticating.

I had planned on all the threads being able to be able to create new
write events using libevent, since the accept()ing threads need to
send the protocol "welcome" and also create a read event for when data
arrives, and the authentication threads need to send back to the
client whether they authenticated or not.

However, before having seen this I implemented it, and the event_set
in the accept() thread is creating an event that is fired in the main
threads event_dispatch(). So, is it okay to continue on this path if I
assure the access of the libevent objects are mutually exclusive?

Thanks,
-Patrick
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to