One of the most common questions posted on our Multithreaded Java programming discussion forum is some version of how to create a thread pool. In nearly every server application, the question of thread pools and work queues comes up. In this article, Brian Goetz explores the motivations for thread pools, some basic implementation and tuning techniques, and some common hazards to avoid.
Dynamic Networks Everything I described so far is common to CSP (Communicating Sequential Processes) and the Actor model. Here’s what makes actors more general: Connections between actors are dynamic. Unlike processes in CSP, actors may establish communication channels dynamically. They may pass messages containing references to actors (or mailboxes). They can then send messages to those actors. Here’s a Scala example: receive { case (name: String, actor: Actor) => actor ! lookup(name) } The original message is a tuple combining a string and an actor object. The receiver sends the result of lookup(name) to the actor it has just learned about. Thus a new communication channel between the receiver and the unknown actor can be established at runtime. (In Kilim the same is possible by passing mailboxes via messages.)
This package is the backport of java.util.concurrent API, introduced in Java 5.0 and further refined in Java 6.0, to older Java platforms. The backport is based on public-domain sources from the JSR 166 CVS repository, the dl.util.concurrent package, and
N. Repčić, I. Šarić, and V. Avdić. Proceedings of the 16th International Research/Expert Conference „Trends in the Development of Machinery and Associated Technology” TMT 2012, page 511-514. Dubai, United Arab Emirates, (2012)