Jump to content

Concurrent programming language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Allan McInnes (talk | contribs) at 04:23, 7 December 2005 (A few grammatical changes to enhance clarity, added a link to occam-pi). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Concurrent programming languages are programming languages that use language constructs for concurrency. These constructs may involve multi-threading, support for distributed computing, message passing, shared resources (including shared memory) or futures (known also as promises).

In some languages communication between concurrent parts of an application 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:

  1. Shared-memory communication, in the which concurrent parts communicate by altering the contents of shared memory locations. This style of concurrent programming usually requires the application of some form of locking (e.g., mutexes, semaphores, or monitors) to coordinate between threads.
  2. Message-passing communication, in which concurrent parts communicate by exchanging messages (as in the Actor model and Process calculi). 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. Messages can be asynchronous (aka "send, pray, and if no acknowledgment send again"), as packets on the Internet, or may use a rendezvous style in which the sender blocks until the message is received, as in TCP on the Internet and synchronous process calculi.

Today, the most commonly used programming languages that have specific constructs for concurrency are Java and C#. Both of these languages fundamentally use a shared-memory concurrency model, with locking provided by monitors (although message-passing models can and have been implemented on top of the underlying shared-memory model).

Languages where concurrency is important

Note that many of these languages are intended more as research languages (e.g., Pict) than as languages for production use. However, several of the examples (such as Erlang, Limbo, and Occam) have seen industrial use at various times in the last 20 years.

Many other languages provide support for concurrency in the form of libraries (on level roughly comparable with the above list).