Simplest threaded example

Hongli Lai honglilai at gmail.com
Tue Aug 3 13:38:33 CEST 2010


Well I see that you're using the same event loop in all worker
threads. That's obviously not gonna work.

What you could do for example is to accept() connections from the main
thread, and for each accepted connection spawn a worker thread that
handles that connection only. Each worker thread must have its own
loop, you can't share loops between threads.



More information about the libev mailing list