[concurrency-interest] Help on design a thread pool, some tasks need to executed in order

Feng Shen 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:
T2, *
T4, *

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?

- Feng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130217/01d59911/attachment.html>

More information about the Concurrency-interest mailing list