This project was developed as part of a data structures coursework. It focuses on comparing the performance of different CPU scheduling simulations using fundamental data structures such as Queue, Stack, Linked List, and Priority Queue. The goal is to understand how each scheduler performs under simultaneous task execution scenarios.
To simulate and analyze the performance of different scheduling strategies based on:
- Response Time
- Turnaround Time
- Execution Time
We implemented the following schedulers:
- Scheduler A: Queue (FIFO)
- Scheduler B: Linked List
- Scheduler C: Stack (LIFO)
- Scheduler D: Priority Queue (Shortest Job First)
- Language: Java
- Time Measurement:
System.nanoTime()for high-precision execution timing - Data Structures: Stack, Queue, LinkedList, PriorityQueue
- Tasks were simulated to arrive simultaneously at the CPU.
- Each task was scheduled using different data structure implementations.
- Execution time and system metrics were recorded and compared.
- Scheduler performance was evaluated based on:
- Time efficiency
- Job ordering logic
- Adaptability to CPU workload
- Queue (FIFO): Simple and predictable but may be inefficient with longer tasks arriving early.
- Linked List: Allows flexible insertion/removal but requires careful management of node pointers.
- Stack (LIFO): Prioritizes newer tasks but can delay long-standing tasks.
- Priority Queue: Implemented SJF; showed the best efficiency in minimizing turnaround time.