Process synchronization:
¡Race Condition:
¡A situation like this where several processes used same
shared data & the final output is depend upon the order of execution of
process.
¡Such type of situation is called Race Condition.
¡To avoid race condition we need some form of Synchronization
called “Process
Synchronization”.
Critical section problem:
¡Each process has a segment of code called critical section.
¡Critical section is used to avoid race conditions on data
items.
¡Suppose there are n process(P1,P2,P3.........Pn)
¡Each process have some code segment called critical section.
¡When one process is executing in its critical section, no
other process is to be allowed to execute in its critical section.
¡Process containing three section,
1 Entry section
2 Exit section
3 Remainder section
Solution for critical section problem:
¡There are three solution for critical section problem.
1-Mutual Exclusion
2-Progress
3-Bounded Waiting
Critical section maintain the above
these condition to avoid the race condition.
No comments:
Post a Comment