Dijkstra - Structure of The The Multi Programming System
Dijkstra - Structure of The The Multi Programming System
Edsger W . Dijkstra
Technological University, Eindhoven, The Netherlands
A multiprogramming system is described in which all ac- Accordingly, I shall try to go beyond just reporting
tivities are divided over a number of sequential processes. what we have done and how, and I shall try to formulate
These sequential processes are placed at various hierarchical as well what we have learned.
levels, in each of which one or more independent abstractions I should like to end the introduction with two short
have been implemented. The hierarchical structure proved to remarks on working conditions, which I make for the sake
be vital for the verification of the logical soundness of the of completeness. I shall not stress these points any further.
design and the correctness of its implementation. One remark is that production speed is severely slowed
down if one works with half-time people who have other
KEY WORDS AND PHRASES: operating system, multlprogrammlng system,
system hierarchy, system structure, real-tlme debugging, program verification, obligations as well. This is at least a factor of four; prob-
synchronizing primitives, cooperating sequential processes, system levels, ably it is worse. The people themselves lose time and
input-outputbufferingt mulfiprogramming, processor sharing, mulfiprocessing' energy in switching over; the group as a whole loses de-
CR CATEGORIES: 4.30, 4.32 cision speed as discussions, when needed, have often to be
postponed until all people concerned are available.
The other remark is that the members of the group
(mostly mathematicians) have previously enjoyed as good
students a university training of five to eight years and
Introduction are of Master's or Ph.D. level. I mention this explicitly
because at least it1 my country the intellectual level needed
In response to a call explicitly asldng for papers "on for system design is in general grossly underestimated. I
timely research and development efforts," I present a am convinced more than ever that this type of work is
progress report on the multiprogramming effort at the very difficult, and that every effort to do it with other than
Department of Mathematics at the Technological Uni- the best people is doomed to either failure or moderate
versity in Eindhoven. success at enormous expense.
Having very limited resources (viz. a group of six peo-
ple of, on the average, haif-time availability) and wishing The Tool a n d the Goal
to contribute to the art of system design--including all
The system has been designed for a Dutch machine, the
the stages of conception, construction, and verification,
EL X8 (N.V. Electrologica, Rijswijk (ZH)). Charac-
we were faced with the problem of how to get the necessary
teristics of our configuration are:
experience. To solve this problem we adopted the follow-
(1) core memory cycle time 2.5usec, 27 bits; at present
ing three guiding principles:
32K;
(1) Select a project as advanced as you can conceive,
(2) drum of 512K words, 1024 words per track, rev.
as ambitious as you can justify, in the hope that routine
time 40msec;
work earl be kept to a minimum; hold out against all pres-
(3) an indirect addressing mechanism very well suited
sure to incorporate such system expansions that would
for stack implementation;
only result into a purely quantitative increase of the total
(4) a sound system for commanding peripherals and
amount of work to be done. controlling of interrupts;
(2) Select a machine with sound basic characteristics
(5) a potentially great number of low capacity chan-
(e.g. an interrupt system to fall in love with is certainly
nels; ten of them are used (3 paper tape readers
an inspiring feature); from then on try to keep the spe- at 1000char/see; 3 paper tape punches at 150char/
cific properties of the configuration for which you are pre- sec; 2 teleprinters; a plotter; a line printer);
paring the system out of your considerations as long as (6) absence of a number of not unusual, awkward
possible.
features.
(3) Be aware of the fact that experience does by no The primary goal of the system is to process smoothly
means automatically lead to wisdom and understanding; a continuous flow of user programs as a service to the Uni-
in other words, make a conscious effort to learn as much as versity. A multiprograrmning system has been chosen
possible fl'om your previous experiences. with the following objectives in mind: (1) a reduction of
Presented at an ACM Symposium on Operating System Principles, turn-around time for programs of short duration, (2)
Gatlinburg, Tennessee, October 1-4, 1967. economic use of peripheral devices, (3) automatic control
APPENDIX
C o m m u n i c a t i o n s of t h e ACM 345
Volume 11 / N u m b e r 5 / May, 1968
the maxinnun value of mutex equals l, the minimum value tlnstabIe si/;uation," such as a free resider and a process
equals - ( n - 1) if we have n parallel processes. needing a. reader. Whenever ~m unstable situation emerges
Critical sections are used always, ~md only for the pur- it is removed (including one or more g-operations on
pose of unambiguous inspection and modification of the private semaphores) in the very same critical section in
state variables (allocated in the surrounding universe) which i{; has been created.
that describe the current state of the system (as far as
needed for the regulation of the ham~onious cooperation Proving the t t a r m o n i o u s C o o p e r a t i o n
between the various processes). The sequential processes in the system east all be re~
garded as cyclic processes in which a certain neutral point
Private Semaphores can be marked, the so-called "homing position," in which
Each sequential process has associated with it a num- all processes are when the system is at rest,.
ber of private semaphores and no other process will ever When a cyclic process leaves its homing position "it
perform a P-operation on them. The universe initializes accepts a task"; when the task has been performed and
them with the value equal to 0, their maximum value
equals 1, and their minhnum value equals - 1 .
Whenever a process reaches a stage where the pemfis-
sion for dynamic progress depends on current values of
not earlier, the process returns to its homing position.
Each eyelie process has a specific task processing power
(e.g. the execution of a user program or unbuffering a
portion of printer output, etc.).
i
state variables, it follows the pattern: The harmonious cooperation is mainly proved in roughly
three stages.
P(mutex) ; (1) It is proved that although a process performing a
"inspection and modification of state variables including task may in so doing generate a finite number of tasks for
a conditional V(private semaphore)"; other processes, a single initial task cannot give rise to an
V (mutex) ; infinite number of task generations. The proof is simple as
P(private semaphore). processes can only generate tasks for processes at lower
If the inspection learns that the process in question levels of the hierarchy so that circularity is excluded.
should eontinne, it performs the operation " V (private (If a process needing a segment from the drum has gener-
semaphore) " - - t h e semaphore value then changes from 0 ated a task for the segment controller, special precautions
to 1--other~4se, this V-operation is skipped, leaving to have been taken to ensure that the segment asked for
the other processes the obligation to perform this V- remains in core at least until the requesting process has
operation at a suitable moment. The absence or presence
of this obligation is reflected in the finM values of the
state variables upon leaving the critical section.
Whenever a process reaches a stage where as a result
effectively accessed the segment concerned. Without this
precaution finite tasks could be forced ~o generate an
infinite number of tasks for the segment controller, and the
system could get stuck in an unproductive page flutter.)
l,i
of its progress possibly one (or more) blocked processes (2) It is proved that it is impossible that all processes
should now get permission to continue, it follows the pat- have returned to their honfing position while somewhere
tern: in the system there is still pending a generated but unae-
eepted task. (This is proved via instability of the situation
P (mutex) ;
just described.)
"modification and inspection of state variables includ-
(3) It is proved that after the acceptance of an initial
ing zero or more V-operations on private semaphores
task all processes eventually will be (again) in their hom-
of other processes";
ing position. Each process blocked in the course of task
V(mutex).
execution relies on the other processes for removal of the
By the introduction of suitable state variables and barrier. Essentially, the proof in question is a demon-
appropriate programming of the critical sections any stration of the absence of "circular waits": process P
strategy assigning peripherals, buffer areas, etc. can be waiting for process Q waiting for process R waiting for
implemented. process P. (Our usual term for the circular wait is "the
The amount of coding and reasoning can be greatly Deadly Embrace.") In a more general society than our
reduced by the observation that in the two complemen- system this proof turned out to be a proof by induction
tary critical sections sketched above the same inspection (on the level of hierarchy, starting at the lowest level), as
can be performed by the introduction of the notion of "an A. N. Habermann has shown in his doctoral thesis.