Process Synchronization
Process Synchronization
When multiple processes execute concurrently sharing system resources, then inconsistent
results might be produced.
Critical section is a section of the program where a process access the shared
resources during its execution.
Problem-
The following two functions P1 and P2 that share a variable B with an initial
value of 2 execute concurrently-
The number of distinct values that B can possibly take after the execution is
Critical Section Problem-
● If multiple processes access the critical section concurrently, then results produced might
be inconsistent.
● This problem is called as critical section problem.
Synchronization Mechanisms-
Any synchronization mechanism proposed to handle the critical section problem should meet
the following criteria-
1. Mutual Exclusion
2. Progress
3. Bounded Wait
1. Mutual Exclusion-
● Interest variable is a synchronization mechanism that provides synchronization among two processes.
● It uses an interest variable to provide the synchronization.
Characteristics-
Peterson’s Solution is a classical software based solution to the critical section problem.
Signal (S2)