Skip to content

HaDoopOP/java-multithread-2_in_Critical-Section

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

java-multithread-2_in_Critical-Section

Consider a scenario where students go to library, students study and students leave the library.
There will be 2 students in the library initially and other 3 will be entering the library.
The condition is that at any point of time there should be at least 2 students studying in the library.(eg if there are only 2 students left in the library and if 1 student is studying then the other student cannot leave.
The last student can only leave once the student who was studying is done studying). You should print the states of the each student whenever they are entering the library, studying or leaving the library and also the total number of students left in the library. Implement this using semaphore

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages