Miracle Emefiele
Laura Zapata
This project simulates how an Operating System schedules processes using different CPU scheduling algorithms.
Algorithms Implemented:
- First-Come, First-Served (FCFS)
- Round Robin (RR)
Process Format Includes:
- Process ID (PID)
- Arrival Time
- Burst Time
- Priority
The Simulation:
- Displays the Gantt Chart showing execution order
- Calculates Waiting Time (WT) and Turnaround Time (TAT)
- Computes average WT and TAT
main.c: Readsprocesses.txt, schedules processes using FCFS and RRfcfs.c: Implementation of FCFSrr.c: Implementation of Round Robinprocesses.txt: Input file listing all processesprocesses.h: Shared structure and function declarationsreport_project1.pdf: Final report
gcc main.c fcfs.c rr.c processes.c -o scheduler
./schedulerThis project simulates real-time process execution using threads and solves the Producer-Consumer synchronization problem using Java threads, semaphores, and synchronized buffer access.
Each process becomes a thread, and CPU burst times are simulated using Thread.sleep().
Producer-Consumer Behavior:
- Producers add processes to a bounded buffer
- Consumers remove and execute processes while ensuring thread-safe access
Simulator.java: Main driver class that manages producer and consumer threadsProcessThread.java: Thread class representing a process with PID and burst timeprocesses.txt: Optional input file (can be hardcoded)report_project2.docx: Final report for Project 2
Inside the os_project2/ folder:
javac Simulator.java ProcessThread.java
java SimulatorProject 1 – Gantt Chart Example
| P1 | P2 | P3 | P4 |
0 2 5 7 12
Project 2 – Producer-Consumer Example
[Producer] Waiting for buffer space...
[Producer] Added Process 2
[Consumer] Retrieved Process 2
[Process 2] started.
[Process 2] finished.
Operating-systems-project/
├── Project1/
│ ├── fcfs.c
│ ├── rr.c
│ ├── main.c
│ ├── processes.c
│ ├── processes.h
│ ├── processes.txt
│ └── report_project1.pdf
│
├── os_project2/
│ ├── Simulator.java
│ ├── ProcessThread.java
│ ├── processes.txt
│ └── report_project2.docx
│
└── README.md
- Project 1 written in C
- Project 2 implemented in Java
- Project 2 uses Java Semaphores, Threads, and proper synchronization
- Designed and tested in VS Code and standard terminal
- Modular and organized structure for easy grading and extension