ArticleslgStudy

computer science

Actor model and process calculi

Actor model and process calculi is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Actor model and process calculi rather than just read about it. In short: In computer science, the Actor model and process calculi are two closely related approaches to the modelling of concurrent digital computation. See Actor model and process calculi history.

Key takeaways

  • Actor model and process calculi belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Actor model and process calculi to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Actor model and process calculi from memory before moving on to harder problems.

Reference excerpt

In computer science, the Actor model and process calculi are two closely related approaches to the modelling of concurrent digital computation. See Actor model and process calculi history. There are many similarities between the two approaches, but also several differences (some philosophical, some technical):

There is only one Actor model (although it has numerous formal systems for design, analysis, verification, modeling, etc.); there are numerous process calculi, developed for reasoning about a variety of different kinds of concurrent systems at various levels of detail (including calculi that incorporate time, stochastic transitions, or constructs specific to application areas such as security analysis). The Actor model was inspired by the laws of physics and depends on them for its fundamental axioms, i.e. physical laws (see Actor model theory); the process calculi were originally inspired by algebra (Milner 1993). Processes in the process calculi are anonymous, and communicate by sending messages either through named channels (synchronous or asynchronous), or via ambients (which can also be used to model channel-like communications (Cardelli and Gordon 1998)). In contrast, actors in the Actor model possess an identity, and communicate by sending messages to the mailing addresses of other actors (this style of communication can also be used to model channel-like communications—see below). The publications on the Actor model and on process calculi have a fair number of cross-references, acknowledgments, and reciprocal citations (see Actor model and process calculi history).

How channels work Indirect communication using channels (e.g. Gilles Kahn and David MacQueen [1977]) has been an important issue for communication in parallel and concurrent computation affecting both semantics and performance. Some process calculi differ from the Actor model in their use of channels as opposed to direct communication.

Synchronous channels Synchronous channels have the property that a sender putting a message in the channel must wait for a receiver to get the message out of the channel before the sender can proceed.

Simple synchronous channels A synchronous channel can be modeled by an Actor that receives put and get communications. The following is the behavior of an Actor for a simple synchronous channel:

Each put communication has a message and an address to which an acknowledgment is sent when the message is received. Each get communication has an address to which the received message is sent. Upon receiving a get communication, the Actor chooses a put communication in FIFO order, and sends the message and acknowledgement to the specified addresses.

Synchronous channels in process calculi However, simple synchronous channels do not suffice for process calculi such as Communicating Sequential Processes (CSP) [Hoare 1978 and 1985] because use of the guarded choice (after Dijkstra) command (called the alternative command in CSP). In a guarded choice command multiple offers (called guards) can be made concurrently on multiple channels to put and get messages; however at most one of the guards can be chosen for each execution of the guarded choice command. Because only one guard can be chosen, a guarded choice command in general effectively requires a kind of two-phase commit protocol or perhaps even a three-phase commit protocol if time-outs are allowed in guards (as in Occam 3 [1992]). Consider the following program written in CSP [Hoare 1978]:

[X :: Z!stop() || Y :: guard: boolean; guard := true; *[guard → Z!go(); Z?guard] || Z :: n: integer; n:= 0; *[X?stop() → Y!false; print!n; [] Y?go() → n := n+1; Y!true] ]

According to Clinger [1981], this program illustrates global nondeterminism, since the nondeterminism arises from incomplete specification of the timing of signals between the three processes X, Y, and Z. The repetitive guarded command in the definition of Z has two alternatives:

the stop message is accepted from X, in which case Y is sent the value false and print is sent the value n a go message is accepted from Y, in which case n is incremented and Y is sent the value true. If Z ever accepts the stop message from X, then X terminates. Accepting the stop causes Y to be sent false which when input as the value of its guard will cause Y to terminate. When both X and Y have terminated, Z terminates because it no longer has live processes providing input. In the above program, there are synchronous channels from X to Z, Y to Z, and Z to Y.

Analogy with the committee coordination problem According to Knabe [1992], Chandy and Misra [1988] characterized this as analogous to the committee coordination problem:

Professors in a university are assigned to various committees. Occasionally a professor will decide to attend a meeting of any of her committees, and will wait until that is possible. Meetings may begin only if there is full attendance. The task is to ensure that if all the members of a committee are waiting, then at least one of them will attend some meeting. The crux of this problem is that two or more committees might share a professor. When that professor becomes available, she can only choose one of the meetings, while the others continue to wait.

A simple distributed protocol This section presents a simple distributed protocol for channels in synchronous process calculi. The protocol has some problems that are addressed in the sections below. The behavior of a guarded choice command is as follows:

The command sends a message to each of its guards to prepare. When it receives the first response from one of its guards that it is prepared, then it sends a message to that guard to prepare to commit and sends messages to all of the other guards to abort. When it receives a message from the guard that it is prepared to commit, then it sends the guard a commit message. However, if the guard throws an exception that it cannot prepare to commit, then guarded choice command starts the whole process all over again. If all of its guards respond that they cannot prepare, then the guarded command does nothing. The behavior of a guard is as follows:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Actor model and process calculi

Start with the simplest possible case. Write down what Actor model and process calculi claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Actor model and process calculi before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Actor model and process calculi ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Actor model and process calculi

In research
Actor model and process calculi appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Actor model and process calculi in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Actor model and process calculi is common in secondary-school and first-year university syllabi. It links to neighbouring topics Actor model (computer science), Process calculi, so understanding it makes those chapters shorter.
In everyday life
Look for Actor model and process calculi outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Actor model and process calculi” →

How to study Actor model and process calculi in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Actor model and process calculi means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Actor model and process calculi out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Actor model and process calculi in simple terms?

In computer science, the Actor model and process calculi are two closely related approaches to the modelling of concurrent digital computation. See Actor model and process calculi history.

Why does Actor model and process calculi matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Actor model and process calculi?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Actor model and process calculi.

Tags

  • Actor model (computer science)
  • Process calculi

Keep exploring