Tuesday, 19 March 2013

Concurrent Processes and Process Synchronization


Processes are concurrent if they exist at the same time in a system. Concurrent processes can function completely independently of one another. Concurrent processes will compete each other for system resources. However, concurrent processes may require occasional synchronization and cooperation to share common resources such as data structure or physical devices. Cooperating concurrent processes must synchronize with each other when they have to use shared resources. Concurrent processes can share all the resources that are serially reusable.

A serially reusable resource can be used at most one process at a time. Its state and operation can be corrupted if manipulated concurrently and without synchronization by more than one process. Examples include read/write shared variables and devices such as printer. Thus, the cooperating concurrent processes must synchronize with each other to preserve the precedence relationships and to prevent the concurrency related timing problems. Failure to devise the appropriate synchronization protocols, and to enforce their use by each process that uses common recourse, often results in erratic system behaviour and crashes that are notoriously difficult to debug.  


Concurrency may result in increased productivity when implemented correctly, but it can degrade reliability when improper synchronization pollutes the system.

Race Condition

A race condition occurs when the scheduling of two processes is so critical that the various orders of scheduling them results in different computations. Race conditions results from the implicit or explicit sharing of data or resources without proper synchronization.

Definition: Race condition- Execution of operations ai and aj on shared data ds by processes Pi and Pj cause race condition if value of ds, after performing operation ai and aj , is not guaranteed to be either fi (fj(ds)) or fj(fi (ds)).

      Index : Operating System

No comments:

Post a Comment