0% found this document useful (0 votes)
3 views8 pages

Dekker's Algorithm

Uploaded by

Apil Neupane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Dekker's Algorithm

Uploaded by

Apil Neupane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Dekker’s Algorithm

Presented by:
Binit KC
Sandesh Uparkoti
Introduction to Dekker's Algorithm

Dekker's algorithm is one of the earliest solutions to the


mutual exclusion problem in concurrent programming,
specifically for two processes.
It is the first known algorithm to solve mutual exclusion in
concurrent processes.
The Mutual Exclusion Problem

Mutual exclusion is a program object that blocks multiple users from


accessing the same shared variable or data at the same time.
Importance
• Prevents race conditions.
• Examples: Bank account transactions, printer access.
Critical Section

Flags
Token
•Purpose: Indicate whether a process
•Purpose: Indicates priority when both
wants to enter the critical section (CS).
•Values: processes have their flags set to TRUE.
•1 (TRUE): Process wants to enter •Values:
•1: One process has priority.
the CS.
•0 (FALSE): Process does not •0: The other process has priority.
want to enter the CS.
•Intent Declaration:
Process 0 declares intent to
enter CS.
•Conflict Resolution:
Checks if Process 1 also
wants to enter; if so, uses
turn to resolve conflict.
•Critical Section Entry:
Enters CS when conflict is
resolved.
•Priority Reassignment:
Gives priority to Process 1
after exiting CS.
•Intent Reset: Resets flag to
indicate exit from CS.
Limitations of Dekker's Algorithm

Wastage of Processor Time


checks if the critical section (CS) is available on a
regular basis. results in a considerable loss of processor time.

 Busy Waiting
•Inefficiency due to constant checking of flags.
 Scalability
•Limited to two processes, difficult to extend.
Conclusion :

Dekker's algorithm is a pioneering solution for achieving mutual

exclusion between two processes, ensuring that only one can access

the critical section at a time. By using two flags and a token for priority

resolution, it effectively prevents race conditions. However, the

algorithm's reliance on busy waiting leads to significant processor

time wastage, and its strict synchronization can cause inefficiencies

known as lockstep synchronization.


Thank you!

You might also like