CMSC 412

NOTE 4

Feb 27, 1999

Basic Concepts about Concurrent Processes

1. Overview

Concurrent processing refers to the situation where two or more processes execute concurrently (i.e., at the same time) and interact during their execution (i.e., by accessing shared memory locations or devices, by exchanging messages, etc.).

Concurrent processing became a field of study because of operating systems. Specifically, a computer system has many (OS and user) processes that run concurrently and interact via shared devices and shared data structures (process tables, file system tables, etc.). But concurrent processing arises in many other areas, including networking, databases, user interfaces, parallel hardware, etc. We first look at concurrent programs in a general context, and only later related them to Operating Systems.

Some common problems to solve in concurrent processing are

2. Concurrent Programs versus Sequential Programs

How is a concurrent program different from a sequential program?

One obvious difference is that a concurrent program has constructs for creating processes, terminating processes, and for processes to communicate with each other (IPC). These constructs may be provided within the programming language (e.g., thread constructors in Java, cobegin and coend in Concurrent Pascal) or as library calls to the OS (e.g., fork and join in Unix, Posix threads).

Concurrent programs are harder than sequential programs to get right because the behavior of a concurrent program depends on the variations in speed of the processes. Each speed variation gives rise to a different execution (starting from the same initial state). Thus a concurrent program can have a great many possible executions. We need to ensure that every one of these executions is correct.

To make sense of a sequential program, one needs to know what each statement in the program does. To make sense of a concurrent program, one needs to know three more attributes:

3. Some Comments