Thread pooling in AIO?
Alan.Bateman at Sun.COM
Tue Dec 16 10:41:43 PST 2008
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.
More information about the nio-discuss