Skip to content

Mahi11Patel/Sleeping-Barber-Problem-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💈 Sleeping Barber Problem Simulation

An interactive web-based simulation of the classic Sleeping Barber Problem from Operating Systems.

This project visually demonstrates synchronization concepts such as semaphores, mutex locks, bounded buffers, and process coordination using an engaging barber shop simulation.


📖 About the Sleeping Barber Problem

The Sleeping Barber Problem is a classic synchronization problem introduced by Edsger Dijkstra.

Problem Scenario

A barber shop consists of:

  • One barber
  • One barber chair
  • A waiting room with limited chairs

Rules

  • If there are no customers, the barber falls asleep.
  • When a customer arrives:
    • If the barber is sleeping, the customer wakes him up.
    • If the barber is busy and waiting chairs are available, the customer waits.
    • If all waiting chairs are occupied, the customer leaves.

This problem is widely used in Operating Systems to demonstrate:

  • Process synchronization
  • Mutual exclusion
  • Producer-consumer behavior
  • Thread communication
  • Resource sharing

✨ Features

  • 🎨 Interactive user interface
  • 💈 Barber sleep and wake animations
  • 👥 Dynamic customer simulation
  • 🪑 Waiting room visualization
  • 📜 Real-time event logging
  • 🔄 Reset simulation functionality
  • 📚 Operating System analogy section

🛠️ Technologies Used

  • HTML5
  • CSS3
  • JavaScript
  • Font Awesome

📂 Project Structure

Sleeping-Barber-Simulation/
│
├── index.html
├── styles.css
├── script.js
└── README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors