A small Java simulation of CPU scheduling (SJF, Round Robin, Priority). The program reads jobs from job.txt, loads them into memory, and runs the chosen scheduler while printing statistics.
- Compile sources to
bin:
javac -d bin src/*.java- Run the program (keep
job.txtin the project root):
java -cp bin MainWhen running, the program will prompt to choose an algorithm:
- Enter
1for SJF - Enter
2for Round Robin - Enter
3for Priority
Place job.txt in the project root. The program's FileReaderTask reads that file to create jobs.
Main.java— program entry, starts FileReader, Loader, and Scheduler.FileReaderTask.java— readsjob.txtinto the job queue.LoaderTask.java— moves jobs into memory/ready queue.Scheduler.java— scheduling logic (SJF, RR, Priority).MemoryManager.java,PCB.java— memory and process control block utilities.
- Memory manager default size = 2048 (set in
Main). - The program uses simple console prompts; run in a terminal for interactive input.
Short and simple — update as needed.