http://www.ioremap.net/node/202#comment-568Mixing async models
By zbr - Posted on March 30th, 2009
Tagged:
What will happen when programmer will not think twice before starting to mix thread and event-driven IO models in the same workload? I can assure you, result will look like a crap. A simple case - storage server, which reads data requests (read or write) from the clients, performs given operation and returns a result. To optimize IO patterns we want to run as much IO requests in parallel as possible, so we can create a pool of threads which will get the work from the client and send replies back. We may dedicate a single thread to process all incoming requests from the given set of clients, and another thread to send replies back. Described example has
a very tricky to resolve bug. Since request
processing is now being split - receiving/processing the request and
sending its result back, we may encounter a resource limitation. For
example we receive a data read request and want to use This is a limitation of the described model only, it is possible to design it properly, but unfortunately my weekend libevent hack was created like shown above. Back to drawing board... |
hi
have you taken a look at boost::asio? it is c++, but very well gear towards async io. single or multi-threaded.