Concurrent computing is the concurrent (simultaneous) execution of multiple interacting computational tasks. In Computer science, concurrency is a properties of system in which several Computational processes are executing at the same time and potentially interacting These tasks may be implemented as separate programs, or as a set of processes or threads created by a single program. Computer programs (also software programs, or just programs) are instructions for a Computer. In computing a process is an instance of a Computer program that is being sequentially executed by a computer system that has the ability to run several computer A thread in Computer science is short for a thread of execution. The tasks may also be executing on a single processor, several processors in close proximity, or distributed across a network. Multiprocessing is the use of two or more central processing units (CPUs within a single computer system Distributed computing deals with Hardware and Software Systems containing more than one processing element or Storage element concurrent Concurrent computing is related to parallel computing, but focuses more on the interactions between tasks. Parallel computing is a form of computation in which many instructions are carried out simultaneously operating on the principle that large problems can often Correct sequencing of the interactions or communications between different tasks, and the coordination of access to resources that are shared between tasks, are key concerns during the design of concurrent computing systems. Pioneers in the field of concurrent computing include Edsger Dijkstra, Per Brinch Hansen, and C. A. R. Hoare. Edsger Wybe Dijkstra ( May 11, 1930 &ndash August 6, 2002; ˈɛtsxər ˈwibə ˈdɛɪkstra was a Dutch computer scientist Per Brinch Hansen (November 13 1938 - July 31 2007 was a Danish-American Computer scientist known for Concurrent programming theory Sir Charles Antony Richard Hoare ( Tony Hoare or CAR Hoare, born January 11, 1934) is a British computer scientist, probably
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. In Computer science, futures and promises are closely related constructs used for synchronization in some concurrent programming languages 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#). In Computing, shared memory is a memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies C# (pronounced C Sharp is a Multi-paradigm This style of concurrent programming usually requires the application of some form of locking (e. g. , mutexes (means mutual exclusion), semaphores, or monitors) to coordinate between threads. Mutual exclusion (often abbreviated to mutex) Algorithms are used in Concurrent programming to avoid the simultaneous use of a common resource such as a For other uses see Semaphore. A semaphore, in computer science is a protected Variable (an entity storing a value or Abstract A monitor is an approach to synchronize two or more computer tasks that use a shared resource usually a hardware device or a set of Variables With monitor-based
- Message passing communication
- Concurrent components communicate by exchanging messages (exemplified by Erlang and occam). In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication Erlang is a general-purpose concurrent Programming language and Runtime system occam is a concurrent Programming language that builds on the Communicating Sequential Processes (CSP process algebra and shares many of its features The exchange of messages may be carried out asynchronously (sometimes referred to as "send and pray", although it is standard practice to resend messages that are not acknowledged as received), or may use a rendezvous style in which the sender blocks until the message is received. Message-passing concurrency tends to be far easier to reason about than shared-memory concurrency, and is typically considered a more robust, although slower, 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. In Computer science, the Actor model is a mathematical model of Concurrent computation that treats "actors" as the universal primitives of concurrent In Computer science, the process calculi (or process algebras) are a diverse family of related approaches to formally modelling Concurrent systems Process Message passing can be efficiently implemented on symmetric multiprocessors using shared coherent memory. In Computing, symmetric multiprocessing or SMP involves a Multiprocessor computer-architecture where two or more identical processors can connect to a single In computing Cache coherency (also cache coherence) refers to the integrity of data stored in local caches of a shared resource
Coordinating access to resources
One of the major issues in concurrent computing is preventing concurrent processes from interfering with each other. For example, consider the following algorithm for making withdrawals from a checking account represented by the shared resource balance:
1 bool withdraw(int withdrawal) {
2 if( balance > withdrawal ) {
3 balance = balance - withdrawal;
4 return true;
5 }
6 return false;
7 }
Suppose balance=500, and two concurrent processes make the calls withdraw(300) and withdraw(350). If line 2 in both operations executes before line 3 both operations will find that balance > withdrawal evaluates to true, and execution will proceed to subtracting the withdrawal amount. However, since both processes perform their withdrawals, the total amount withdrawn will end up being more than the original balance. These sorts of problems with shared resources require the use of concurrency control, or non-blocking algorithms. In Computer science, especially in the fields of Computer programming (see also Concurrent programming, Parallel programming) Operating systems In Computer science, non-blocking synchronization ensures that threads competing for a shared resource do not have their execution indefinitely
Because concurrent systems rely on the use of shared resources (including communications mediums), concurrent computing in general requires the use of some form of arbiter somewhere in the implementation to mediate access to these resources. Metastability in electronics is the ability of a non-equilibrium electronic state to persist for a long (and theoretically unlimited period of time (see Asynchronous circuit
Unfortunately, while many solutions exist to the problem of a conflict over one resource, many of those "solutions" have their own concurrency problems such as deadlock when more than one resource is involved. In Computer science, concurrency is a properties of system in which several Computational processes are executing at the same time and potentially interacting A deadlock is a situation wherein two or more competing actions are waiting for the other to finish and thus neither ever does
Advantages
- Increased application throughput - the number of tasks done in certain time period will increase.
- High responsiveness for input/output - input/output-intensive applications mostly wait for input or output operations to complete. Concurrent programming allows the time that would be spent waiting to be used for another task.
- More appropriate program struct - some problems and problem domains are well-suited to representation as concurrent tasks or processes.
Concurrent programming languages
Concurrent programming languages are programming languages that use language constructs for concurrency. A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer. In Computer science, concurrency is a properties of system in which several Computational processes are executing at the same time and potentially interacting These constructs may involve multi-threading, support for distributed computing, message passing, shared resources (including shared memory) or futures (known also as promises). A thread in Computer science is short for a thread of execution. Distributed computing deals with Hardware and Software Systems containing more than one processing element or Storage element concurrent In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication Sharing is the joint use of a resource or space In its narrow sense it refers to joint or alternating use of an inherently finite good such as a common pasture or a Timeshared A Parallel Random Access Machine ( PRAM) is an Abstract machine for designing the Algorithms applicable to Parallel computers It eliminates the In Computer science, futures and promises are closely related constructs used for synchronization in some concurrent programming languages
Today, the most commonly used programming languages that have specific constructs for concurrency are Java and C#. C# (pronounced C Sharp is a Multi-paradigm 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). A monitor is an approach to synchronize two or more computer tasks that use a shared resource usually a hardware device or a set of Variables With monitor-based Of the languages that use a message-passing concurrency model, Erlang is probably the most widely used in industry at present. Erlang is a general-purpose concurrent Programming language and Runtime system
Many concurrent programming languages have been developed more as research languages (e. g. Pict) rather than as languages for production use. Pict is a statically typed Programming language based on the Pi-calculus, one of very few languages to do this However, languages such as Erlang, Limbo, and occam have seen industrial use at various times in the last 20 years. Languages in which concurrency plays an important role include:
- Ada
- Afnix – concurrent access to data is protected automatically (previously called Aleph, but unrelated to Alef)
- Alef – concurrent language with threads and message passing, used for systems programming in early versions of Plan 9 from Bell Labs
- Alice – extension to Standard ML, adds support for concurrency via futures. Ada is a structured, Statically typed, imperative, and object-oriented high-level computer Programming language Afnix (until 2003 developed under name Aleph) is a Multi-threaded functional Programming language with dynamic symbol bindings that support the The Alef programming language was designed by Phil Winterbottom of Bell Labs as part of the Plan 9 operating system. Plan 9 from Bell Labs is a Distributed operating system, primarily used for research Alice is a Functional programming language designed by the Programming Systems Lab at Saarland University. Standard ML ( SML) is a general-purpose modular, Functional programming language with Compile-time type checking and Type inference
- CDL (Concurrent Description Language), a machine-translatable, composable, object-oriented, visual programming language.
- Cilk – a concurrent C
- Cω – C Omega, a research language extending C#, uses asynchronous communication
- Concurrent C. Cilk is a general-purpose Programming language designed for multithreaded Parallel programming. tags please moot on the talk page first! --> In Computing, C is a general-purpose cross-platform block structured Cω (pronounced C Omega, /Ō-mē'gɘ/ or /Ō-mĕg'ɘ/ usually written as "Cw" or "Comega language" is a free extension to the C#
- Concurrent Clean – a functional programming language, similar to Haskell
- Concurrent ML – a concurrent extension of Standard ML
- Concurrent Pascal – by Brinch-Hansen
- Corn
- Compute Unified Device Architecture (CUDA)
- Curry
- E – uses promises, ensures deadlocks cannot occur
- Eiffel – through its SCOOP mechanism based on the concepts of Design by Contract
- Erlang – uses asynchronous message passing with nothing shared
- Janus features distinct "askers" and "tellers" to logical variables, bag channels; is purely declarative
- JoCaml
- Join Java – concurrent language based on the Java programming language
- Joule – dataflow language, communicates by message passing
- Concurrent Haskell – lazy, pure functional language operating concurrent processes on shared memory
- Limbo – relative of Alef, used for systems programming in Inferno (operating system)
- MultiLisp – Scheme variant extended to support parallelism
- occam – influenced heavily by Communicating Sequential Processes (CSP). In Computer science, Clean is a general-purpose Purely functional Computer programming language. Haskell is a standardized Purely functional Programming language with non-strict semantics, named after the Logician Haskell Curry Concurrent ML (CML is a concurrent extension of the Standard ML programming language Standard ML ( SML) is a general-purpose modular, Functional programming language with Compile-time type checking and Type inference Concurrent Pascal was designed by Per Brinch Hansen for writing Concurrent programs such as Operating systems and real-time monitoring systems on Shared Per Brinch Hansen (November 13 1938 - July 31 2007 was a Danish-American Computer scientist known for Concurrent programming theory CUDA ( Compute Unified Device Architecture) is a Compiler and set of development tools that enable programmers to use a variation of C to Curry is an experimental functional logic Programming language, based on the Haskell language E is an Object-oriented programming language for secure Distributed computing, created by Mark S Eiffel is an ISO -standardized Object-oriented Programming language designed to enable programmers to efficiently develop extensible reusable reliable Scoop is a Content management system originally developed by Rusty Foster. Erlang is a general-purpose concurrent Programming language and Runtime system Janus is a computer programming language partially described by K JoCaml is an experimental Functional programming language derived from OCaml. Join Java is a Programming language that extends the standard Java programming language with the Join Semantics of the Join Calculus. Joule is a concurrent Dataflow programming language designed for building distributed applications. Concurrent Haskell extends Haskell 98 with explicit concurrency Limbo is a Programming language for writing distributed systems and is the language used to write applications for the Inferno Operating system The Alef programming language was designed by Phil Winterbottom of Bell Labs as part of the Plan 9 operating system. Inferno is an Operating system for creating and supporting distributed services MultiLisp is a functional Programming language and dialect of the Lisp dialect Scheme, extended with constructs for parallel execution Scheme is a Multi-paradigm programming language. It is one of the two main dialects of Lisp and supports a number of programming paradigms but is occam is a concurrent Programming language that builds on the Communicating Sequential Processes (CSP process algebra and shares many of its features In Computer science, Communicating Sequential Processes ( CSP) is a formal language for describing Patterns of Interaction in Concurrent
- Orc – a heavily concurrent, nondeterministic language based on Kleene algebra. In Computer science, occam-π (or occam-pi) is the name of a variant of the occam developed by the Kent Retargetable occam Compiler ( KRoC occam is a concurrent Programming language that builds on the Communicating Sequential Processes (CSP process algebra and shares many of its features In Theoretical computer science, the \pi-calculus is a Process calculus originally developed by Robin Milner, Joachim Parrow and Orc is a concurrent, nondeterministic computer Programming language created by Jayadev Misra at the University of Texas at Austin. In Mathematics, a Kleene algebra (named after Stephen Cole Kleene, ˈkleɪni as in "clay-knee" is either of two different things A
- Oz – multiparadigm language, supports shared-state and message-passing concurrency, and futures
- Pict – essentially an executable implementation of Milner's π-calculus
- SALSA – actor language with token-passing, join, and first-class continuations for distributed computing over the Internet
- Scala – a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way
- SR – research language
Many other languages provide support for concurrency in the form of libraries (on level roughly comparable with the above list). Oz is a Multiparadigm programming language, developed in the Programming Systems Lab at Saarland University. The Mozart Programming System is a Multiplatform implementation of the Oz Programming language developed by the Mozart Consortium. In computing cross-platform (also known as multi-platform) is a term used to refer to Computer software or computing methods and concepts that are implemented Pict is a statically typed Programming language based on the Pi-calculus, one of very few languages to do this In Theoretical computer science, the \pi-calculus is a Process calculus originally developed by Robin Milner, Joachim Parrow and The SALSA programming language ( S imple A ctor L anguage S ystem and A rchitecture is an actor-oriented programming language Scala ( Scalable Language) is a multi-paradigm Programming language designed to integrate features of Object-oriented programming and SR (short for Synchronizing Resources) is a Programming language designed for Concurrent programming.
Models of concurrency
There are several models of concurrent computing, which can be used to understand and analyze concurrent systems. These models include:
See also
Bibliography
- Filman, Robert E. In Computer science, the Actor model is a mathematical model of Concurrent computation that treats "actors" as the universal primitives of concurrent A Petri net (also known as a place/transition net or P/T net) is one of several Mathematical Modeling languages for the description of discrete In Computer science, the process calculi (or process algebras) are a diverse family of related approaches to formally modelling Concurrent systems Process In Computer science, the ambient calculus is a process calculus devised by Luca Cardelli and Andrew D The Calculus of Communicating Systems (CCS is a Process calculus introduced by Robin Milner in around 1980 In Computer science, Communicating Sequential Processes ( CSP) is a formal language for describing Patterns of Interaction in Concurrent In Theoretical computer science, the \pi-calculus is a Process calculus originally developed by Robin Milner, Joachim Parrow and In Computer science, message passing is a form of communication used in Parallel computing, Object-oriented programming, and Interprocess communication Other 'Ptolemy Projects' exist including a medical one named for Ptolemy I Soter. A race condition or race hazard is a flaw in a System or process whereby the output and/or result of the process is unexpectedly and critically dependent In Concurrent programming a critical section is a piece of Code that accesses a shared resource (data structure or device that must not be concurrently accessed by For other meanings see the disambiguation page at Transaction. In Computer science, flow-based programming ( FBP) is a Programming paradigm that defines applications as networks of "black box" ; Daniel P. Friedman. Coordinated Computing: Tools and Techniques for Distributed Software origyear=1984. New York: McGraw-Hill, 370. ISBN 0-07-022439-0.
External links
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
network: | |