|
Boost Users : |
Subject: [Boost-users] Multithread event handling
From: Alessandro Bellina (abellina_at_[hidden])
Date: 2010-01-22 22:00:42
Hello boost,
Traditionally, I think of services as having a thread pool or manually
managed threads to handle requests and produce responses. I have been
looking at boost::asio and tbb as an alternative to this in order to take
advantage of multiple cores. Also, I think that implementing an event
handler with asio or tbb should provide better performance over a
threadpool.
Do you have any suggestions? So far, I have implemented an example using
tbb::task_group and spawned tasks. This yielded full CPU utilization, but
since these are very short lived tasks, the task creation overhead took
over.
Using io_service, it seems to be as easy as posting to the service, and
running it among different threads. Would this be the correct approach for
my case?
Can somebody share their experiences on libraries or patterns used to
implement an event handling mechanism?
Thanks,
Alessandro
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net