[concurrency-interest] Help on design a thread pool, some tasks need to executed in order
fshen at avos.com
Sun Feb 17 04:44:40 EST 2013
I am developing a HTTP Server with WebSocket support. The thread model:
One IO thread to accept connection, read bytes, decoding request, hand the
request to a threadpool.
HTTP has no ordering requirement, But websocket has: a client can sent
several messages to server, these messages should be handled in order.
So I need a thread pool with some ordering guarantee. For example:
T4 can be executed only after T2 complete. But the other tasks has no
ordering requirement, thus can be executed in parallel.
Would appreciate for any thought about how to design such a thread pool?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest