- CPU Scheduling of Operating System
- 23.05.06์ผ - 23.05.13์ผ
- 23.05.17์ผ - 23.05.21์ผ
- 23.06.19์ผ - 23.06.21์ผ [FIX & Latest Upload]
- Language : Java(jdk 1.8(Zulu Open JDK 11.04), Java 11)
- Tool : JetBrain IntelliJ IDEA CE
- ์์ ์ด ๋์ฐฉํ ์์๋๋ก ์ฒ๋ฆฌ๋๋ ๋ฐฉ์์ผ๋ก ๋์.
- ๋จผ์ ๋์ฐฉํ ์์ ์ด ๋จผ์ ์คํ๋๊ณ , ์์ ์ด ์๋ฃ๋ ๋๊น์ง ๋ค๋ฅธ ์์ ์ ๋๊ธฐ. [ํธ์ํจ๊ณผ - Convoy effect]
- ๋์ฐฉํ ์์์ ์๊ด์์ด ์คํ ์๊ฐ์ด ๊ฐ์ฅ ์งง์ ์์ ์ด ๋จผ์ ์คํ๋๋ ํน์ง.
- ํ๊ท ๋๊ธฐ ์๊ฐ์ ์ต์ํํ ์ ์๋ ์๊ณ ๋ฆฌ์ฆ
- ์ฐ์ ์์ ํ๋ก ๊ตฌํ
- ๊ฐ ์์ ์ ๋์ผํ ์๊ฐ ํ ๋น๋์ ๋ถ์ฌ (Quantum)
- ํ ๋น๋ ์๊ฐ ๋์ ์์ ์ ์คํํ ํ ๋ค์ ์์ ์ผ๋ก ์ ํํ๋ ๋ฐฉ์์ผ๋ก ๋์
- (Process 1)์ CPU Burst๊ฐ ์คํํ ๋ค I/O๊ฐ ์งํ๋๋ค๋ฉด (Process 1)์ด์ธ์ ๋ค๋ฅธ ํ๋ก์ธ์ค์๊ฒ CPU๋ฅผ ํ ๋นํ์ฌ ์ค์ผ์ค๋งํ๋ ๋ฐฉ์
- Open the terminal
- git clone https://github.com/WellshCorgi/implement-cpu-scheduling-java.git
- cd implement-cpu-scheduling-java/src
- javac Main.java
- [
Let's run the Java file]- java Main data.txt FCFS 0
- java Main data.txt SJF 0
- java Main data.txt RoundRobin 1
- java Main data.txt RoundRobin 10
- java Main data.txt RoundRobin 100
- n (A,C,B,IO)
- n is count of processes
- The time when the process arrived is A
- Let C be the total CPU time required until the process ends.
- Turnaround Time(Finishing Time - @param A)
- CPU burst time is the unique distributed random integer between 0 and any number B.
- IO burst time is the unique distributed random integer between 0 and any number IO.
-
1 (0 5 1 1)
-
3 (0 5 1 1)(0 5 1 1)(3 5 1 1)
-
5 (0 200 3 3)(0 500 9 3)(0 500 20 3)(100 100 1 0)(100 500 100 3)
- Case 1 [์ด๋ค ์ถ๋ ฅ์ด๋ ๊ณ ์ ๋ ๊ฐ]
============= [ Summary of Scheduler ] =============
Scheduler Finishing Time : 9
Average turnaround time : 9.00
Average waiting time : 0.00
CPU Utilization : 55.56 %
I/O Utilization : 44.44 %
Throughput in processes completed per hundred time units : 11.11 %
- Case 2 [์ด๋ค ์ถ๋ ฅ์ด๋ ๊ณ ์ ๋ ๊ฐ]
============= [ Summary of Scheduler ] =============
Scheduler Finishing Time : 15
Average turnaround time : 12.67
Average waiting time : 3.67
CPU Utilization : 100.00 %
I/O Utilization : 80.00 %
Throughput in processes completed per hundred time units : 20.00 %
- Other Case
Cpu Burst , Io Burst๊ฐ Random๊ฐ์ผ๋ก ์ค์ฐจ๋ฒ์์ ๊ฐ ์ด๋ด์ ๊ฒฐ๊ณผ ์ถ๋ ฅ
- 5/22 -> Fixed SJF, RoundRobin Improved the way logic works.
- 6/21 -> I got feedback from the professor in charge and redesigned all the working methods.
- ์๋ฐ ๋์์ธ ํจํด (SRP,DIP)๋ฅผ ์ ์ฉํ๊ธฐ ๋ฐ OCP ๊ท์น ์๋ฐ ์์ ํ๊ธฐ. [Applying Java design patterns and implementing SRP, correcting OCP rule violations]