next up previous contents
Next: 3.2.2 Semaphores Up: 3.2 Synchronization of parallel Previous: 3.2 Synchronization of parallel   Contents


3.2.1 Some definitions

Remark : Sequential programming is only the expression of our inability to transfer the natural parallelism of the world to a machine.
Problems occur with the administration of parallel processes : Synchronization :
Prevention of an undefined status of a variable by means of a mechanism which allows processes to access on that variable in a defined way.

Barrier :
Certain point in a program which has to be passed by all processes (or a group of processes) before the execution continues. This guarantees that each single process has to wait until also all remaining processes have reached that program point.

Ex.: Undefined status

An undefined status may occur in the access on shared memory.

Figure 3.3: Undefined status.
\begin{figure}\begin{tabular}{ccc}
\fbox{ process A: $N := N+1$ }& clock.&
...
...$ \\
{\sc store} $N$ & (3) & {\sc store} $N$ \\
\end{tabular} \end{figure}

The value of $ N$ depends on the execution speed of processes A, B and is therefore not predictable, i.e., the status of $ N$ is undefined.

Figure 3.4: Results in an undefined status
\begin{figure}Case a) \hfill
\unitlength0.06\textwidth
\begin{picture}(11,1)(0...
...0,0){(2)}}
\put(7,0.5){\makebox(0,0){(3)}}
\end{picture} \ [2ex] \end{figure}

For omitting the above undefined status, one has to regard operations A and B as atomic operations, i.e., they cannot be split any further.
$ \Longrightarrow$ Exclusive access on $ N$ for one process during that time is needed to finish the operation.
One realization of exclusive access will be presented in the next section.


next up previous contents
Next: 3.2.2 Semaphores Up: 3.2 Synchronization of parallel Previous: 3.2 Synchronization of parallel   Contents
Gundolf Haase 2000-03-20