Concurrent programming language: Difference between revisions

Content deleted Content added
CarlHewitt (talk | contribs)
No edit summary
Koffieyahoo (talk | contribs)
Reverted part of the Changes by CarlHewitt, they remove useful info from the article
Line 1:
'''Concurrent programming languages''' are those that provide linguistic mechanisms for programmingcreating concurrency.concurrent These languageor multi-threading,threaded operatingprograms. systemsThis andin networkingcontrast to providelanguages such as [[C]], which only support concurrency. through the use of libraries or operating system features.
 
Communication in concurrentConcurrent programming languages can essentially be divided into two classes:
#Shared-memory communication, in which threads communicate by changing 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.
#Message-passing communication, in which messages are sent to recipients as in the [[Actor model]] and [[Process calculi]]. Message-passing concurrency tends to be far easier to reason about than shared-state concurrency, and is typically considered a more robust form of concurrent programming. Messages can be asynchronous (aka "send and pray"), as in [[Internet Protocol|IP]] on the [[Internet]], or may use a rendezvous style in which the sender blocks until the message is received, as in process calculi.
 
* Shared-state languages, in which separate threads of execution can access the same data directly. This style of concurrent programming requires the application of some form of locking (e.g. mutexes, semaphores, or monitors) to ensure that only a single thread is manipulating the shared data at any one time. This form of concurrency can be difficult to reason about, and is prone to errors as a result of improperly coordinated locks. The [[Java programming language|Java]] programming language is an example of the shared-state style.
The [[Java programming language|Java]] and [[C sharp|C#]] programming languages make use of both of the above kinds of communcication
 
* Message-passing languages, in which data is strictly encapsulated within a thread of execution, and can only be modified by passing messages to the responsible thread. Messages can be asynchronous (aka "send and pray"), as in [[Erlang]], or may use a rendezvous style in which the sender blocks until the message is received, as in [[Occam]]. The inspiration for this style of language is theoretical work on concurrency such as Milner's [[Pi-Calculus]] and Hoare's [[Communicating Sequential Processes|CSP]]. Message-passing concurrency tends to be far easier to reason about than shared-state concurrency, and is typically considered a more robust form of concurrent programming.
 
==Examples==
Line 23:
*[[Occam programming language|Occam]] - influenced heavily by [[Communicating Sequential Processes]].
*[[Pict-language|Pict]] - essentially an executable implementation of Milner's [[Pi-Calculus]].
*[[PL/I]]
*[[Promise (programming)]]
*[[SR language|SR]]