[concurrency-interest] ForkJoinPool for async http calls?

Doug Lea dl at cs.oswego.edu
Sat May 12 10:39:44 EDT 2012

Trying to summarize...

On 05/10/12 16:52, Zhong Yu wrote:
> while that is super cool, it is not as simple and elegant as thread:)
> the reason we do these async stuff is because threads are "expensive".
> but why are threads expensive?

Ultimately, it is a matter of resource management.
If you'd like a lot of something, then that something ought
to be cheap to create, manage, and reclaim.
The full java.lang.Thread API is intrinsically not
all that cheap (similarly for OS-level pthreads etc).
But if you'd like something that maintains much of the
elegance of a thread but is cheap enough so that you
can usually have as many as you like without having
to make other design trade-offs, then we can help.
Hence: ForkJoinTasks, scala/akka actors, composible
completions, and so on.

All things considered, the more such components and
abstractions available that turn out to be helpful
(well, except not *too* many of them), the less people will
miss not using java.lang.Thread.


More information about the Concurrency-interest mailing list