Support Materials for Language and System Support for Concurrent Programming

Abstract

The first example is an implementation in each of four languages (Ada, Concurrent C, Co-Pascal, and occam) of the famous Dining Philosophers problem first stated by Dijkstra. In this metaphorical statement of deadlock and resource allocation problems, five philosophers sit around a circular table, in the center of which is a infinitely large bowl of Chinese food. To the left and right of each philosopher is a single chopstick; each philosopher must try to acquire both chopsticks, each for awhile, then put down the chopsticks and think for awhile; this cycle repeats for some total number of meals. (Dijkstra's original formulation used spaghetti and forks; we prefer the chopstick setting because most people can eat spaghetti with one fork.) The algorithm for chopstick selection must be chosen carefully, otherwise if all philosophers grab, say, their left chopsticks and refuse to yield them, all will starve! The second example is one we have used with repeated success at The George Washington University, namely a sort race in which the three different sorting methods are activated as processes. Each sort displays its progress in its window (usually a single row) on the terminal; mutual exclusion is necessary to protect the screen, which is a writable shared resource. We have found this example interesting and fun-there is a lot of screen activity, the problem being solved is obvious, and the three independent sorts serve as placeholders for any three independent applications contending for the processor and a shared data structure. (kr)

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Apr 01, 1990
Accession Number
ADA223739

Entities

People

  • Gary A. Ford
  • Michael B. Feldman

Organizations

  • Carnegie Mellon University

Tags

Communities of Interest

  • Human Systems

DTIC Thesaurus Topics

  • Abstracts
  • Algorithms
  • C Programming Language
  • Computer Programming
  • Department Of Defense
  • Education
  • Electronic Mail
  • Engineering
  • High Level Languages
  • Intellectual Property
  • Language
  • Materials
  • Software Development
  • Software Metrics
  • United States
  • United States Government
  • Universities

Readers

  • Artificial Intelligence
  • Military History of the United States in the 20th Century.
  • Military Logistics and Supply Chain Management