[concurrency-interest] ForkJoinPool for async http calls?
mthornton at optrak.com
Fri May 11 03:46:54 EDT 2012
On 11/05/12 04:03, Zhong Yu wrote:
> Yes thread-per-connection doesn't work, today. My question is, could
> OS/VM do some optimization to make it work? Or there are reasons
> prohibiting that?
There have been VMs designed to run tens of thousands of threads even in
a 32 bit system. One of the critical resources in a VM like HotSpot is
the address reserved for each thread's stack. Typically this is 256K in
a 32 bit system. This clearly limits the number of threads you can have.
I remember a VM which allocated much smaller stacks initially (8K
perhaps) and then expanded the stack if it became full (expensive, but
hopefully rare). The rationale here was to permit the one thread per
connection model to scale to very large numbers of connections.
More information about the Concurrency-interest