next up previous
Next: Shared Memory in Up: XINU Processes and Previous: XINU Processes and

Concurrent Execution of Processes

Modern operating systems allow several processes to execute concurrently. It is not difficult to imagine several independent processes each being concurrently executed statement-by-statement on a different machine. But what does it mean for an operating system to provide concurrent processing on a single processor, which can execute only one statement at a time?

On a single processor, the OS, to create the illusion of concurrency, switches a single processor among several processes, allowing it to run one for only a few thousandths of a second before moving on to another. When viewed by a human, these processes appear to run concurrently.

Thus in the example, the execution of the three processes is interleaved. As a result, the output on the screen is a mixture of `As' and `Bs'.


Prasun Dewan
Thu Aug 21 10:36:49 EDT 1997