Skip to content

shivam-moray/Sleeping-Barber-Problem-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Sleeping-Barber-Problem-Java

A short description of the sleeping barber problem

A barber shop has an entrance from where the customers enter to have a haircut. Inside there are a set of X barbers who cut the hair of customer one at a time and if there are no customers he sleeps in his chair. If customer arrives and finds the barber asleeps then he goes to the waiting room checks if seats are available he goes and sits on the chair otherwise exits the shop.

This program has been modidfed for multiple barbers with mutli core implementation from the multi threaded solution for one barber. The source code is referenced from https://orajavasolutions.wordpress.com/tag/sleeping-barber-problem/ This site contains the implementation of sleeping barber problem using wait() and notify() which is fairly easy to understand. Also I have included few resources which shows different types of solutions to the sleeping barber problem, you can check them out below.

Refrences

https://orajavasolutions.wordpress.com/tag/sleeping-barber-problem/ https://www.cs.helsinki.fi/u/kerola/rio/ohjeet/Java/semaphores/s06e-huhtamaki-merikanto-nevalainen/SleepingBarber.java https://javaexplorer03.blogspot.com/2016/05/sleeping-barber-problem.html https://njavatech.blogspot.com/2014/03/sleeping-barber-problem-using-reentrant.html https://www.geeksforgeeks.org/sleeping-barber-problem-in-process-synchronization/ https://github.com/ylegat/sleeping-barber/blob/master/src/exercise/Main.java https://massivetechinterview.blogspot.com/2015/08/sleeping-barber-problem-oracle-java.html https://njavatech.blogspot.com/2014/03/sleeping-barber-problem-using-semaphores.html https://github.com/MikeChristianson/sleeping-barber/tree/master/src/name/christianson/mike https://vyatkins.wordpress.com/2013/12/21/sleeping-barber-problem/

About

A multi threaded, multi core solution to the sleeping barber problem in Java using Java Threads and Executor Service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages