ADS

Sunday 20 May 2018

Process synchronization

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,

Entry section

Exit section

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.

¡Mutual Exclusion: Only one process is executing in their critical section at a time & other process is execute in the remainder section.


¡Bounded Waiting: There is a bounded time for each process in which any request can be grant.


¡Progress: If there is no process in the critical section and any process wants to enter in their critical section than section of process to enter in critical section can not be postponed indefinitely.

No comments:

Post a Comment

Popular Posts