# Concurrency (computer science)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Concurrency_(computer_science)
> Markdown URL: https://mediated.wiki/source/Concurrency_(computer_science).md
> Source: https://en.wikipedia.org/wiki/Concurrency_(computer_science)
> Source revision: 1340987200
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Ability to execute a task in a non-serial manner

"Concurrent computer" redirects here. For the company, see [Concurrent Computer Corporation](/source/Concurrent_Computer_Corporation).

For a more practical discussion, see [Concurrent computing](/source/Concurrent_computing). For other uses, see [Concurrency (disambiguation)](/source/Concurrency_(disambiguation)).

In [computer science](/source/Computer_science), **concurrency** refers to the ability of a system to execute multiple tasks through simultaneous execution or time-sharing (context switching), sharing resources and managing interactions. Concurrency improves responsiveness, throughput, and [scalability](/source/Scalability) in modern computing, including: [1][2][3][4][5]

- [Operating systems](/source/Operating_system) and [embedded systems](/source/Embedded_system)

- [Distributed systems](/source/Distributed_computing), [parallel computing](/source/Parallel_computing), and [high-performance computing](/source/High-performance_computing)

- [Database systems](/source/Database), [web applications](/source/Web_application), and [cloud computing](/source/Cloud_computing)

## Related concepts

Concurrency is a broader concept that encompasses several related ideas, including: [1][2][3][4][5]

- [Parallelism](/source/Parallel_computing) (simultaneous execution on multiple processing units). Parallelism executes tasks independently on multiple CPU cores. Concurrency allows for multiple *threads of control* at the program level, which can use parallelism or time-slicing to perform these tasks. Programs may exhibit parallelism only, concurrency only, both parallelism and concurrency, neither.[6]

- [Multi-threading](/source/Multithreading_(computer_architecture)) and [multi-processing](/source/Multiprocessing) (shared system resources)

- [Synchronization](/source/Synchronization) (coordinating access to shared resources)

- Coordination (managing interactions between concurrent tasks)

- [Concurrency Control](/source/Concurrency_control) (ensuring data consistency and integrity)

- [Inter-process Communication](/source/Inter-process_communication) (IPC, facilitating information exchange)

## Issues

Because computations in a concurrent system can interact with each other while being executed, the number of possible execution paths in the system can be extremely large, and the resulting outcome can be [indeterminate](/source/Indeterminacy_in_concurrent_computation). Concurrent use of shared [resources](/source/Resource_(computer_science)) can be a source of indeterminacy, leading to issues such as [deadlocks](/source/Deadlock_(computer_science)), and [resource starvation](/source/Resource_starvation).[7]

Design of concurrent systems often entails finding reliable techniques for coordinating their execution, data exchange, [memory allocation](/source/Memory_allocation), and execution scheduling to minimize [response time](/source/Latency_(engineering)) and maximize [throughput](/source/Throughput).[8]

## Theory

Concurrency theory has been an active field of research in [theoretical computer science](/source/Theoretical_computer_science). One of the first proposals was [Carl Adam Petri](/source/Carl_Adam_Petri)'s seminal work on [Petri nets](/source/Petri_net) in the early 1960s. In the years since, a wide variety of formalisms have been developed for modeling and reasoning about concurrency.

### Models

A number of formalisms for modeling and understanding concurrent systems have been developed, including:[9]

- The [parallel random-access machine](/source/Parallel_random-access_machine)[10]

- The [actor model](/source/Actor_model)

- Computational bridging models such as the [bulk synchronous parallel](/source/Bulk_synchronous_parallel) (BSP) model

- [Petri nets](/source/Petri_net)

- [Process calculi](/source/Process_calculi) - [Calculus of communicating systems](/source/Calculus_of_communicating_systems) (CCS) - [Communicating sequential processes](/source/Communicating_sequential_processes) (CSP) model - [π-calculus](/source/%CE%A0-calculus)

- [Tuple spaces](/source/Tuple_space), e.g., [Linda](/source/Linda_(coordination_language))

- [Simple Concurrent Object-Oriented Programming](/source/SCOOP_(software)) (SCOOP)

- [Reo Coordination Language](/source/Reo_Coordination_Language)

- [Trace monoids](/source/Trace_monoid)

Some of these models of concurrency are primarily intended to support reasoning and specification, while others can be used through the entire development cycle, including design, implementation, proof, testing, and simulation of concurrent systems. Some of these are based on [message passing](/source/Message_passing), while others have different mechanisms for concurrency.

The proliferation of different models of concurrency has motivated some researchers to develop ways to unify these different theoretical models. For example, Lee and Sangiovanni-Vincentelli have demonstrated that a so-called "tagged-signal" model can be used to provide a common framework for defining the [denotational semantics](/source/Denotational_semantics) of a variety of different models of concurrency,[11] while Nielsen, Sassone, and Winskel have demonstrated that [category theory](/source/Category_theory) can be used to provide a similar unified understanding of different models.[12]

The Concurrency Representation Theorem in the actor model provides a fairly general way to represent concurrent systems that are closed in the sense that they do not receive communications from outside. (Other concurrency systems, e.g., [process calculi](/source/Process_calculi) can be modeled in the actor model using a [two-phase commit protocol](/source/Two-phase_commit_protocol).[13]) The mathematical denotation denoted by a closed system S is constructed increasingly better approximations from an initial behavior called ⊥S using a behavior approximating function **progression**S to construct a denotation (meaning) for S as follows:[14]

- - **Denote**S ≡ ⊔i∈ω **progression**Si(⊥S)

In this way, S can be mathematically characterized in terms of all its possible behaviors.

### Logics

Various types of [temporal logic](/source/Temporal_logic)[15] can be used to help reason about concurrent systems. Some of these logics, such as [linear temporal logic](/source/Linear_temporal_logic) and [computation tree logic](/source/Computation_tree_logic), allow assertions to be made about the sequences of states that a concurrent system can pass through. Others, such as [action computational tree logic](https://en.wikipedia.org/w/index.php?title=Action_computational_tree_logic&action=edit&redlink=1), [Hennessy–Milner logic](/source/Hennessy%E2%80%93Milner_logic), and [Lamport's](/source/Leslie_Lamport) [temporal logic of actions](/source/Temporal_logic_of_actions), build their assertions from sequences of *actions* (changes in state). The principal application of these logics is in writing specifications for concurrent systems.[7]

## Practice

This section does not cite any sources. Please help improve this section by adding citations to reliable sources. Unsourced material may be challenged and removed. (April 2007) (Learn how and when to remove this message)

[Concurrent programming](/source/Concurrent_programming) encompasses programming languages and algorithms used to implement concurrent systems. Concurrent programming is usually considered[*[by whom?](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions)*] to be more general than [parallel programming](/source/Parallel_programming) because it can involve arbitrary and dynamic patterns of communication and interaction, whereas parallel systems generally[*[according to whom?](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions)*] have a predefined and well-structured communications pattern. The base goals of concurrent programming include *correctness*, *performance* and *robustness*. Concurrent systems such as [Operating systems](/source/Operating_system) and [Database management systems](/source/Database_management_system) are generally designed[*[by whom?](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions)*] to operate indefinitely, including automatic recovery from failure, and not terminate unexpectedly (see [Concurrency control](/source/Concurrency_control)). Some[*[example needed](https://en.wikipedia.org/wiki/Wikipedia:AUDIENCE)*] concurrent systems implement a form of transparent concurrency, in which concurrent computational entities may compete for and share a single resource, but the complexities of this competition and sharing are shielded from the programmer.

Because they use shared resources, concurrent systems in general[*[according to whom?](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Words_to_watch#Unsupported_attributions)*] require the inclusion of some[*[example needed](https://en.wikipedia.org/wiki/Wikipedia:AUDIENCE)*] kind of [arbiter](/source/Arbiter_(electronics)) somewhere in their implementation (often in the underlying hardware), to control access to those resources. The use of arbiters introduces the possibility of [indeterminacy in concurrent computation](/source/Indeterminacy_in_concurrent_computation) which has major implications for practice including correctness and performance. For example, arbitration introduces [unbounded nondeterminism](/source/Unbounded_nondeterminism) which raises issues with [model checking](/source/Model_checking) because it causes explosion in the state space and can even cause models to have an infinite number of states.

Some concurrent programming models include [coprocesses](/source/Coprocess) and [deterministic concurrency](/source/Deterministic_concurrency). In these models, threads of control explicitly [yield](/source/Yield_(multithreading)) their timeslices, either to the system or to another process.

## See also

- [Dining philosophers problem](/source/Dining_philosophers_problem)

- [Chu space](/source/Chu_space)

- [Client–server](/source/Client%E2%80%93server) network nodes

- [Clojure](/source/Clojure)

- [Cluster](/source/Cluster_computing) nodes

- [Concurrency control](/source/Concurrency_control)

- [Concurrent computing](/source/Concurrent_computing)

- [Concurrent object-oriented programming](/source/Concurrent_object-oriented_programming)

- [Concurrency pattern](/source/Concurrency_pattern)

- [Construction and Analysis of Distributed Processes](/source/Construction_and_Analysis_of_Distributed_Processes) (CADP)

- [D (programming language)](/source/D_(programming_language))

- [Distributed system](/source/Distributed_computing)

- [Elixir (programming language)](/source/Elixir_(programming_language))

- [Erlang (programming language)](/source/Erlang_(programming_language))

- [Go (programming language)](/source/Go_(programming_language))

- [Gordon Pask](/source/Gordon_Pask)

- [International Conference on Concurrency Theory](/source/International_Conference_on_Concurrency_Theory) (CONCUR)

- [OpenMP](/source/OpenMP)

- [Parallel computing](/source/Parallel_computing)

- [Partitioned global address space](/source/Partitioned_global_address_space)

- [Pony (programming language)](/source/Pony_(programming_language))

- [Processes](/source/Process_(computing))

- [Ptolemy Project](/source/Ptolemy_Project)

- [Rust (programming language)](/source/Rust_(programming_language))

- [Sheaf (mathematics)](/source/Sheaf_(mathematics))

- [Threads](/source/Thread_(computing))

- [X10 (programming language)](/source/X10_(programming_language))

- [Structured concurrency](/source/Structured_concurrency)

## References

1. ^ [***a***](#cite_ref-:0_1-0) [***b***](#cite_ref-:0_1-1) *Operating System Concepts*. Wiley. 29 July 2008. [ISBN](/source/ISBN_(identifier)) [978-0470128725](https://en.wikipedia.org/wiki/Special:BookSources/978-0470128725).

1. ^ [***a***](#cite_ref-:1_2-0) [***b***](#cite_ref-:1_2-1) *Computer Organization and Design: The Hardware/Software Interface*. The Morgan Kaufmann Series in Computer Architecture and Design. Morgan Kaufmann. 2012. [ISBN](/source/ISBN_(identifier)) [978-0123747501](https://en.wikipedia.org/wiki/Special:BookSources/978-0123747501).

1. ^ [***a***](#cite_ref-:2_3-0) [***b***](#cite_ref-:2_3-1) *Distributed Systems: Concepts and Design*. Pearson. 2012. [ISBN](/source/ISBN_(identifier)) [978-0132143011](https://en.wikipedia.org/wiki/Special:BookSources/978-0132143011).

1. ^ [***a***](#cite_ref-:3_4-0) [***b***](#cite_ref-:3_4-1) Quinn, Michael Jay (1994). *Parallel Computing: Theory and Practice*. McGraw-Hill. [ISBN](/source/ISBN_(identifier)) [978-0070512948](https://en.wikipedia.org/wiki/Special:BookSources/978-0070512948).

1. ^ [***a***](#cite_ref-:4_5-0) [***b***](#cite_ref-:4_5-1) Zomaya, Albert Y. (1996). *Parallel and Distributed Computing Handbook*. McGraw Hill Professional. [ISBN](/source/ISBN_(identifier)) [978-0070730205](https://en.wikipedia.org/wiki/Special:BookSources/978-0070730205).

1. **[^](#cite_ref-6)** *Parallel and Concurrent Programming in Haskell*. O'Reilly Media. 2013. [ISBN](/source/ISBN_(identifier)) [9781449335922](https://en.wikipedia.org/wiki/Special:BookSources/9781449335922).

1. ^ [***a***](#cite_ref-cleaveland1996_7-0) [***b***](#cite_ref-cleaveland1996_7-1) [Cleaveland, Rance](/source/Rance_Cleaveland); Scott Smolka (December 1996). ["Strategic Directions in Concurrency Research"](https://doi.org/10.1145%2F242223.242252). *ACM Computing Surveys*. **28** (4): 607. [doi](/source/Doi_(identifier)):[10.1145/242223.242252](https://doi.org/10.1145%2F242223.242252). [S2CID](/source/S2CID_(identifier)) [13264261](https://api.semanticscholar.org/CorpusID:13264261).

1. **[^](#cite_ref-8)** Campbell, Colin; Johnson, Ralph; Miller, Ade; Toub, Stephen (August 2010). [*Parallel Programming with Microsoft .NET*](http://msdn.microsoft.com/en-us/library/ff963542.aspx). Microsoft Press. [ISBN](/source/ISBN_(identifier)) [978-0-7356-5159-3](https://en.wikipedia.org/wiki/Special:BookSources/978-0-7356-5159-3).

1. **[^](#cite_ref-9)** Filman, Robert; Daniel Friedman (1984). [*Coordinated Computing - Tools and Techniques for Distributed Software*](https://archive.org/details/coordinatedcompu0000film). McGraw-Hill. [ISBN](/source/ISBN_(identifier)) [978-0-07-022439-1](https://en.wikipedia.org/wiki/Special:BookSources/978-0-07-022439-1).

1. **[^](#cite_ref-10)** Keller, Jörg; Christoph Keßler; Jesper Träff (2001). *Practical PRAM Programming*. John Wiley and Sons.

1. **[^](#cite_ref-11)** Lee, Edward; Alberto Sangiovanni-Vincentelli (December 1998). ["A Framework for Comparing Models of Computation"](http://ptolemy.eecs.berkeley.edu/publications/papers/98/framework/ieeeVersion.pdf) (PDF). *IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems*. **17** (12): 1217–1229. [doi](/source/Doi_(identifier)):[10.1109/43.736561](https://doi.org/10.1109%2F43.736561).

1. **[^](#cite_ref-12)** Mogens Nielsen; Vladimiro Sassone; Glynn Winskel (1993). ["Relationships Between Models of Concurrency"](http://citeseer.ist.psu.edu/article/nielsen94relationships.html). *REX School/Symposium*.

1. **[^](#cite_ref-13)** Frederick Knabe. A Distributed Protocol for Channel-Based Communication with Choice PARLE 1992.

1. **[^](#cite_ref-clinger1981_14-0)** [William Clinger](/source/William_Clinger_(computer_scientist)) (June 1981). "Foundations of Actor Semantics". Mathematics Doctoral Dissertation. MIT. [hdl](/source/Hdl_(identifier)):[1721.1/6935](https://hdl.handle.net/1721.1%2F6935). {{[cite journal](https://en.wikipedia.org/wiki/Template:Cite_journal)}}: Cite journal requires |journal= ([help](https://en.wikipedia.org/wiki/Help:CS1_errors#missing_periodical))

1. **[^](#cite_ref-stirling_15-0)** Roscoe, Colin (2001). *Modal and Temporal Properties of Processes*. Springer. [ISBN](/source/ISBN_(identifier)) [978-0-387-98717-0](https://en.wikipedia.org/wiki/Special:BookSources/978-0-387-98717-0).

## Further reading

- Lynch, Nancy A. (1996). [*Distributed Algorithms*](https://archive.org/details/distributedalgor0000lync). Morgan Kaufmann. [ISBN](/source/ISBN_(identifier)) [978-1-55860-348-6](https://en.wikipedia.org/wiki/Special:BookSources/978-1-55860-348-6).

- Tanenbaum, Andrew S.; Van Steen, Maarten (2002). *Distributed Systems: Principles and Paradigms*. Prentice Hall. [ISBN](/source/ISBN_(identifier)) [978-0-13-088893-8](https://en.wikipedia.org/wiki/Special:BookSources/978-0-13-088893-8).

- Kurki-Suonio, Reino (2005). *A Practical Theory of Reactive Systems*. Springer. [ISBN](/source/ISBN_(identifier)) [978-3-540-23342-8](https://en.wikipedia.org/wiki/Special:BookSources/978-3-540-23342-8).

- Garg, Vijay K. (2002). *Elements of Distributed Computing*. Wiley-IEEE Press. [ISBN](/source/ISBN_(identifier)) [978-0-471-03600-5](https://en.wikipedia.org/wiki/Special:BookSources/978-0-471-03600-5).

- Magee, Jeff; Kramer, Jeff (2006). *Concurrency: State Models and Java Programming*. Wiley. [ISBN](/source/ISBN_(identifier)) [978-0-470-09355-9](https://en.wikipedia.org/wiki/Special:BookSources/978-0-470-09355-9).

- Distefano, S., & Bruneo, D. (2015). *Quantitative assessments of distributed systems: Methodologies and techniques* (1st ed.). Somerset: John Wiley & Sons Inc.[ISBN](/source/ISBN_(identifier)) [9781119131144](https://en.wikipedia.org/wiki/Special:BookSources/9781119131144)

- Bhattacharyya, S. S. (2013;2014;). *Handbook of signal processing systems* (Second;2;2nd 2013; ed.). New York, NY: Springer.10.1007/978-1-4614-6859-2 [ISBN](/source/ISBN_(identifier)) [9781461468592](https://en.wikipedia.org/wiki/Special:BookSources/9781461468592)

- Wolter, K. (2012;2014;). *Resilience assessment and evaluation of computing systems* (1. Aufl.;1; ed.). London;Berlin;: Springer. [ISBN](/source/ISBN_(identifier)) [9783642290329](https://en.wikipedia.org/wiki/Special:BookSources/9783642290329)

## External links

- [Process Algebra Diary - Prof. Luca Aceto's blog on Concurrency Theory](http://processalgebra.blogspot.com/)

- [Concurrent Systems](https://web.archive.org/web/20060128114620/http://vl.fmnet.info/concurrent/) at [The WWW Virtual Library](http://vlib.org/)

- [Concurrency patterns presentation](http://shairosenfeld.com/concurrency.html) given at [scaleconf](http://scaleconf.org)

v t e Concurrent computing General Concurrency Concurrency control Concurrent data structures Concurrent hash tables Concurrent users Indeterminacy Linearizability Process calculi CSP CCS ACP LOTOS π-calculus Ambient calculus API-Calculus PEPA Join-calculus Classic problems ABA problem Cigarette smokers problem Deadlock Dining philosophers problem Producer–consumer problem Race condition Readers–writers problem Sleeping barber problem Category: Concurrent computing

---
Adapted from the Wikipedia article [Concurrency (computer science)](https://en.wikipedia.org/wiki/Concurrency_(computer_science)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Concurrency_(computer_science)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
