Skip to main navigation Skip to search Skip to main content

Processes, Tasks, and Monitors: A Comparative Study of Concurrent Programming Primitives

  • Brown University
  • Stony Brook University

Research output: Contribution to journalArticlepeer-review

19 Scopus citations

Abstract

Three notations for concurrent programming are compared, namely CSP, Ada, and monitors. CSP is an experimental language for exploring structuring concepts in concurrent programming. Ada is a general-purpose language with concurrent programming facilities. Monitors are a construct for managing access by concurrent processes to shared resources. We start by comparing “lower-level” communication, synchronization, and nondeterminism in CSP and Ada and then examine “higher-level” module interface properties of Ada tasks and monitors. Similarities between CSP and Ada include use of the “cobegin” construct for nested process initiation and the “rendezvous” mechanism for synchronization. Differences include the mechanisms for task naming and nondeterminism. One-way (procedure-style) naming of called tasks by calling tasks in Ada is more flexible than the two-way naming in CSP. The general-purpose nondeterminism of guarded commands in CSP is cleaner than the special-purpose nondeterminism of the select statement in Ada. Monitors and tasks are two different mechanisms for achieving serial access to shared resources by concurrently callable procedures. Both rely on queues to achieve serialization, but calls on monitor procedures are scheduled on a single monitor queue while task entry calls are scheduled on separate queues associated with each entry name. Monitors are passive modules which are activated by being called, while tasks are active modules that execute independently of their callers. Monitor procedures represent multiple threads of control each of which may be suspended and later resumed, while tasks have just a single thread of control. The attempt to map a monitor version of a shortest job scheduler into Ada yields interesting insights into the limitations of Ada mechanisms for synchronization, and suggests that Ada packages may be more appropriate than tasks as a user interface for concurrent computation.

Original languageEnglish
Pages (from-to)446-462
Number of pages17
JournalIEEE Transactions on Software Engineering
VolumeSE-9
Issue number4
DOIs
StatePublished - Jul 1983

Keywords

  • Ada
  • concurrent programming
  • CSP
  • distributed processes
  • monitors
  • processes
  • tasks

Fingerprint

Dive into the research topics of 'Processes, Tasks, and Monitors: A Comparative Study of Concurrent Programming Primitives'. Together they form a unique fingerprint.

Cite this