Concurrent Interaction and Communication
In some concurrent computing systems, communication between the concurrent components is hidden from the programmer (e.g., by using futures), while in others it must be handled explicitly. Explicit communication can be divided into two classes:
- Shared memory communication
- Concurrent components communicate by altering the contents of shared memory locations (exemplified by Java and C#). This style of concurrent programming usually requires the application of some form of locking (e.g., mutexes, semaphores, or monitors) to coordinate between threads.
- Message passing communication
- Concurrent components communicate by exchanging messages (exemplified by Scala, Erlang and occam). The exchange of messages may be carried out asynchronously, or may use a rendezvous style in which the sender blocks until the message is received. Asynchronous message passing may be reliable or unreliable (sometimes referred to as "send and pray"). Message-passing concurrency tends to be far easier to reason about than shared-memory concurrency, and is typically considered a more robust form of concurrent programming. A wide variety of mathematical theories for understanding and analyzing message-passing systems are available, including the Actor model, and various process calculi. Message passing can be efficiently implemented on symmetric multiprocessors, with or without shared coherent memory.
Shared memory and message passing concurrency have different performance characteristics. Typically (although not always), the per-process memory overhead and task switching overhead is lower in a message passing system, but the overhead of message passing itself is greater than for a procedure call. These differences are often overwhelmed by other performance factors.
Read more about this topic: Concurrent Computing
Famous quotes containing the words concurrent and/or interaction:
“I have been too long acquainted with human nature to have great regard for human testimony; and a very great degree of probability, supported by various concurrent circumstances, conspiring in one point, will have much greater weight with me, than human testimony upon oath, or even upon honour; both of which I have frequently seen considerably warped by private views.”
—Philip Dormer Stanhope, 4th Earl Chesterfield (16941773)
“Recent studies that have investigated maternal satisfaction have found this to be a better prediction of mother-child interaction than work status alone. More important for the overall quality of interaction with their children than simply whether the mother works or not, these studies suggest, is how satisfied the mother is with her role as worker or homemaker. Satisfied women are consistently more warm, involved, playful, stimulating and effective with their children than unsatisfied women.”
—Alison Clarke-Stewart (20th century)