Thread pooling in AIO?
David M. Lloyd
david.lloyd at redhat.com
Tue Dec 16 16:04:59 PST 2008
On 12/16/2008 12:41 PM, Alan Bateman wrote:
> David M. Lloyd wrote:
>> I think a fixed pool is probably the wrong choice for async I/O - it
>> would make more sense to use a cached pool which can scale up on
>> demand, with a sensible timeout for non-core threads.
> If the server is completely event driven then a fixed thread pool can
> work very well.
> One word of warning is one needs to be careful to avoid idle
> timeout/keep alive on Windows due to the way that I/O works on that
> platform. I/O operations are tied in the kernel to the initiating
> thread; if a thread terminates (because it is idle) then outstanding I/O
> operations that it has initiated may be aborted.
Interesting. To me that suggests that there ought to be a special Executor
or ThreadFactory implementation for the Windows case then - one which knows
not to kill a thread if there's an outstanding operation on it.
More information about the nio-discuss