i have a few questions regarding libevent2 and its multithread support.
Does libevent support multiple Threads? What i would like to achieve is something like this:
Is it possible to do s.th like this with libevent? Or are there any other approaches to support multiple cores?
Thank you very much
You would need some support for thread pooling. As of 2.0.x Libevent doesn't have one of these built in right now, but it might in the future.
There have been a few proposed extensions you might want to look into. Mark Ellzey has a library called "libevthr" that he uses for thread pools in libevhtp. You can find it in the libevhtp repository. Mark Heily has a proposed patch to add an EV_PARALLEL flag to let Libevent use libpthread_workqueue. It appeared on the libevent-users mailing list here.
If neither of those works out for you, you could do it yourself by picking any work-queue implementation that you like, and writing a Libevent callback to automatically queue your real callback for another thread.