GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - moocf/dekker-algorithm.java: Dekker's algorithm is the first known correct solution to the mutual exclusion problem in concurrent programming.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Main.java
Main.java
 
 
README.md
README.md
 
 

Repository files navigation

Dekker's algorithm is the first known correct solution to the mutual exclusion problem in concurrent programming. The solution is attributed to Dutch mathematician Th. J. Dekker by Edsger W. Dijkstra. It allows two threads to share a single-use resource without conflict, using only shared memory for communication.

Java already provides a ReentrantLock. This is for educational purposes only.

Course: Concurrent Data Structures, Monsoon 2020
Taught by: Prof. Govindarajulu Regeti

process(i):
1. I want to enter CS.
2. If you want CS too  ...
3a. If its my turn, retry 2.
4a. If its your turn, i dont want to enter.
4b. I wait for you turn to complete.
4c. I now want to enter, retry 2.
5. I enter CS (sleep).
6. Its your turn now.
7. I dont want CS.
## OUTPUT
Starting 2 processes (threads) ...
1: want CS
0: want CS
1: in CS0
1: done CS
1: want CS
0: in CS0
0: done CS
0: want CS
1: in CS1
1: done CS
1: want CS
0: in CS1
0: done CS
1: in CS2
0: want CS
1: done CS
1: want CS
0: in CS2
0: done CS
0: want CS
0: in CS3
0: done CS
1: in CS3
1: done CS

See Main.java for code, and repl.it for output.

references

  • Computer Architecture - Dekker's Algorithm :: intrigano
  • Dekker's algorithm in Process Synchronization :: GeeksforGeeks
  • Dekker's algorithm

About

Dekker's algorithm is the first known correct solution to the mutual exclusion problem in concurrent programming.

Topics

algorithmconcurrencyconcurrentdatadekkerjavapatternstructure

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

1 watching

Forks

1 fork
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.