This is a simple Java project that demonstrates the implementation of basic Operating System concepts like semaphores, threads, and CPU scheduling algorithms.
The main aim is to help understand how these concepts work through hands-on coding examples.
Features
- Semaphores
- Binary and counting semaphore implementations
- Examples: Producer-Consumer problem, Reader-Writer problem
- Threading
- Creating and managing threads using
Thread
andRunnable
- Thread lifecycle and basic synchronization
- CPU Scheduling Algorithms
- First-Come First-Serve (FCFS)
- Shortest Job First (SJF)
- Round Robin (RR)
- Shows waiting time, turnaround time, and order of execution
How to Run
- Make sure you have Java installed (Java 8 or higher).
- Open the project in IntelliJ IDEA or any Java IDE.
- Go to the
src
folder and run the class you want to try. - Input will be either hardcoded or asked via console depending on the program.
This is mainly for students who are learning Operating Systems and want to see how the theory applies in code. It's written in a beginner-friendly way without too much complexity.
If you have improvements or want to add more OS concepts (like deadlocks, memory management), feel free to open a pull request.