In
computer scienceComputer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...
,
concurrency is a property of systems in which several
computationComputation is a general term for any type of information processing. This includes phenomena ranging from human thinking to calculations with a more narrow meaning. Computation is a process following a well-defined model that is understood and can be expressed in an algorithm, protocol, network...
s are executing simultaneously, and potentially interacting with each other. The computations may be executing on multiple cores in the same chip,
preemptively time-sharedIn computing, preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task at a later time. Such a change is known as a context switch...
threadsIn computer science, a thread of execution results from a fork of a computer program into two or more concurrently running tasks. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...
on the same processor, or executed on physically separated processors.
A number of mathematical models have been developed for general concurrent computation including Petri nets, process calculi, the synchronous model and the
Actor modelIn computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and...
.
Because computations in a concurrent system can interact with each other while they are executing, the number of possible execution paths in the system can be extremely large, and the resulting outcome can be indeterminate.
In
computer scienceComputer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe and transform...
,
concurrency is a property of systems in which several
computationComputation is a general term for any type of information processing. This includes phenomena ranging from human thinking to calculations with a more narrow meaning. Computation is a process following a well-defined model that is understood and can be expressed in an algorithm, protocol, network...
s are executing simultaneously, and potentially interacting with each other. The computations may be executing on multiple cores in the same chip,
preemptively time-sharedIn computing, preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task at a later time. Such a change is known as a context switch...
threadsIn computer science, a thread of execution results from a fork of a computer program into two or more concurrently running tasks. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...
on the same processor, or executed on physically separated processors.
A number of mathematical models have been developed for general concurrent computation including Petri nets, process calculi, the synchronous model and the
Actor modelIn computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and...
.
Issues
Because computations in a concurrent system can interact with each other while they are executing, the number of possible execution paths in the system can be extremely large, and the resulting outcome can be indeterminate. Concurrent use of shared
resourcesA resource, or system resource, is any physical or virtual component of limited availability within a computer system. Every device connected to a computer system is a resource. Every internal system component is a resource...
can be a source of indeterminacy leading to issues such as
deadlockA deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does. It is often seen in a paradox like the "chicken or the egg."...
, and
starvationIn computer science, starvation is a multitasking-related problem, where a process is perpetually denied necessary resources. Without those resources, the program can never finish its task ....
.
The design of concurrent systems often entails finding reliable techniques for coordinating their execution, data exchange, memory allocation, and execution scheduling to minimize response time and maximise throughput.
Theory
Concurrency theory has been an active field of research in
theoretical computer scienceTheoretical computer science is the collection of topics of computer science that focuses on the more abstract, logical and mathematical aspects of computing, such as the theory of computation, analysis of algorithms, and semantics of programming languages...
. One of the first proposals was
Carl Adam PetriCarl Adam Petri is a German mathematician and computer scientist. He was born in Leipzig.Petri nets were invented in August 1939 by Carl Adam Petri – at the age of 13 – for the purpose of describing chemical...
's seminal work on
Petri NetA Petri net is one of several mathematical modeling languages for the description of discrete distributed systems. A Petri net is a directed bipartite graph, in which the nodes represent transitions , places A Petri net (also known as a place/transition net or P/T net) is one of several...
s 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:
- The Parallel Random Access Machine
A Parallel Random Access Machine is a shared memory abstract machine which is used by parallel algorithms designers to estimate the algorithm performance . PRAM neglects such issues as synchronization and communication, but provides any number of processors...
- The Actor model
In computer science, the Actor model is a mathematical model of concurrent computation that treats "actors" as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and...
- Petri net
A Petri net is one of several mathematical modeling languages for the description of discrete distributed systems. A Petri net is a directed bipartite graph, in which the nodes represent transitions , places A Petri net (also known as a place/transition net or P/T net) is one of several...
s
- Process calculi
- Tuple space
A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently. As an illustrative example, consider that there are a group of processors that produce pieces of data and a group of...
s, e.g., LindaIn computer science, Linda is a model of coordination and communication among several parallel processes operating upon objects stored in and retrieved from shared, virtual, associative memory....
- SCOOP
SCOOP stands for Simple Concurrent Object Oriented Programming. It is a concurrency model designed for the Eiffel programming language, conceived by Eiffel's creator & designer, Bertrand Meyer....
(Simple Concurrent Object-Oriented Programming)
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.
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 semanticsIn computer science, denotational semantics is an approach to formalizing the meanings of programming languages by constructing mathematical objects which describe the meanings of expressions from the languages...
of a variety of different models of concurrency, while Nielsen, Sassone, and Winskel have demonstrated that
category theoryIn mathematics, category theory deals in an abstract way with mathematical structures and relationships between them: it abstracts from sets and functions to objects linked in diagrams by morphisms or arrows....
can be used to provide a similar unified understanding of different models.
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 can be modeled in the Actor model using a
two-phase commit protocolIn transaction processing, databases, and computer networking, the two-phase commit protocol is a type of an atomic commitment protocol. It is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction on whether to commit or abort the...
.) 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
progressionS to construct a denotation (meaning ) for
S as follows:
-
- DenoteS ≡ ⊔i∈ω progressionSi(⊥S)
In this way,
S can be mathematically characterized in terms of all its possible behaviors.
Logics
Various types of
temporal logicIn logic, the term temporal logic is used to describe any system of rules and symbolism for representing, and reasoning about, propositions qualified in terms of time. It is sometimes also used to refer to tense logic, a particular modal logic-based system of temporal logic introduced by Arthur...
can be used to help reason about concurrent systems. Some of these logics, such as
linear temporal logicLinear temporal logic is a modal temporal logic with modalities referring to time. In LTL, one can encode formulae about the future of paths such as that a condition will eventually be true, that a condition will be true until another fact becomes true, etc.-Syntax:LTL is built up from a set of...
and
computational tree logicComputation tree logic is a branching-time logic, meaning that its model of time is a tree-like structure in which the future is not determined; there are different paths in the future, any one of which might be an actual path that is realised...
, allow assertions to be made about the sequences of states that a concurrent system can pass through. Others, such as action computational tree logic,
Hennessy-Milner logicThe Hennessy-Milner logic is a modal logic in computer science. It is used to specify properties of a labeled transition system, a structure similar to an automaton...
, and
Lamport'sLeslie Lamport is an American computer scientist. A graduate of the Bronx High School of Science, he received a B.S. in mathematics from the Massachusetts Institute of Technology in 1960, and M.A. and Ph.D. degrees in mathematics from Brandeis University, respectively in 1963 and 1972...
temporal logic of actionsTemporal logic of actions is a logic developed by Leslie Lamport, which combines temporal logic with a logic of actions.It is used to describe behaviours of concurrent systems....
, build their assertions from sequences of
actions (changes in state). The principal application of these logics is in writing specifications for concurrent systems.
Practice
Concurrent programming encompasses the programming languages and algorithms used to implement concurrent systems. Concurrent programming is usually considered to be more general than parallel programming because it can involve arbitrary and dynamic patterns of communication and interaction, whereas parallel systems generally 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 are generally designed to operate indefinitely and not terminate unexpectedly. Some concurrent systems implement a form of
transparentAny change in a computing system, such as new feature or new component, is transparent if the system after change adheres to previous external interface as much as possible while changing its internal behaviour. The purpose is to shield from change all systems on the other end of the interface...
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 require the inclusion of some kind of
arbiter-Asynchronous arbiters:An important form of arbiter is used in asynchronous circuits, to select the order of access to a shared resource among asynchronous requests. Its function is to prevent two operations from occurring at once when they should not...
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 which has major implications for practice including correctness and performance. For example arbitration introduces
unbounded nondeterminismIn computer science, unbounded nondeterminism or unbounded indeterminacy is a property of concurrency by which the amount of delay in servicing a request can become unbounded as a result of arbitration of contention for shared resources while still guaranteeing that the request will eventually be...
which raises issues with
model checkingIn the field of logic in computer science, model checking refers to the following problem:Given a model of a system, test automatically whether this model meets a given specification....
because it causes explosion in the state space and can even cause models to have an infinite number of states.
See also
- Client-server
Client-server computing or networking is a distributed application architecture that partitions tasks or work loads between service providers and service requesters, called clients. Often clients and servers operate over a computer network on separate hardware...
network nodes
- Cluster
Cluster Computing: the Journal of Networks, Software Tools and Applications is a journal for parallel processing, distributed computing systems, and computer communication networks....
nodes
- Concurrency control
In computer science, especially in the fields of computer programming , operating systems , multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.-Concurrency control in...
- Concurrent computing
Concurrent computing is a form of computing in which programs are designed as collections of interacting computational processes that may be executed in parallel...
- Concurrency pattern
In software engineering, concurrency patterns are those types of design patterns that deal with multi-threaded programming paradigm.Examples of this class of patterns include:* Active Object* Balking pattern* Double checked locking pattern...
- Chu space
Chu spaces generalize the notion of topological space by dropping the requirements that the set of open sets be closed under union and finite intersection, that the open sets be extensional, and that the membership predicate be two-valued...
- Sheaf (mathematics)
In mathematics, a sheaf is a tool for systematically tracking locally defined data attached to the open sets of a topological space. The data can be restricted to smaller open sets, and the data assigned to an open set is equivalent to all collections of compatible data assigned to collections of...
- Distributed system
Distributed computing is a field of computer science that studies distributed systems. A distributed system consists of multiple autonomous computers that communicate through a computer network. The computers interact with each other in order to achieve a common goal...
nodes
- OpenMP
The OpenMP is an application programming interface that supports multi-platform shared memory multiprocessing programming in C, C++ and Fortran on many architectures, including Unix and Microsoft Windows platforms...
- Processes
In computing, a process is an instance of a computer program, consisting of one or more threads, that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently....
- Ptolemy Project
- Threads
In computer science, a thread of execution results from a fork of a computer program into two or more concurrently running tasks. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...
External links