i tried looking in the mailing list to see if this has already been answered, but i could not find it.

my prog is sitting in the main loop, and i am using "poll". an event comes in, a thread is spawned off. meanwhile, the main thread goes back to the main loop. The spawned thread needs to add a new event (e.g. calling event_add with EV_READ on a socket) and then the thread exits. the problem is the event is added after the main thread goes back to the main loop, and the new event is not added to poll (i checked via strace), until another event is called and the main loop is started again.

what i did for a hack is added an alarm for 1 second, but i do not like relying on it, and since the spawned thread is not persistant, i do think adding another event base is the way to go. any ideas on how to get this working? i am thinking the only way is to restart the main loop immediately, but i could not find a way to do that cleanly.

thank you very much,
-=- adam grossman
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to