There is a simple way to fix the problem. Considering that the only race condition that could occur is when the selector thread tests the write queue and then change the OP_WRITE flag to true, and when the writer queue add some new request in the queue, and set the OP_WRITE to true, the solution is to synchronize those two parts of the code.
This is what we now have in trunk. We still have one missing part to add : the thread setting the OP_WRITE flag to true *must* wakeup the selector, but sadly, in the AbstractIoSession, we don't have a way to do that. W will have to store teh selector in the session somehow... -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com