Computer/Operating system

09 Uniprocessor Scheduling(1)

코머 2021. 10. 26. 00:39

1.  Scheduling

Basic Term

- Turnaround time : 프로그램의 시작부터 완료까지 걸리는 시간 (오늘날 사용자의 입출력에 의한 프로그램에서는 큰 의미가 없다)

- Response time : Input이 들어오고 output까지 걸리는 시간, 알고리즘이나 컴퓨터의 포화상태에 따라 달라짐

- Deadlines : 마감기한, ex) 동영상 프레임 33ms

- Troughput : 단위 시간당 처리를 끝낸 프로세스 개수

- processor utillization : CPU가 시간 당 바쁜 비율

  (순수한 CPU 이용률 - 다른 작업들을 제외하고 순수하게 프로그램을 돌리는데 사용된 CPU 이용률)

  over head가 심할 경우 이용률 떨어짐

 

Aim of Schuduling(목적)

1) Response time 줄이기

2) Throughtput 늘이기

=> CPU 이용률을 높이기 위함

 

Short-Term Scheduling

- dispatcher 또는 scheduler 함수에 의해 실행됨 (커널 안에 있는 함수)

- 가장 자주 실행되는 함수

 

Priorities

- Scheduler : 우선순위가 제일 높은 프로세스를 골라서 CPU에게 전달

- 같은 우선순위인 것들끼리 각각의 ready queue가 따로 존재

 

Process Switch 발생 시점

1) Memory fault interrupt 발생 

2) I/O 함수 호출 : scanf()시 데이터 없을 경우 -> scheduler() 호출 -> CPU 넘김

3) I/O interrupt

4) Clock interrupt

5) Trap interrupt

=>  모든 interrupt handler 마지막에 항상 scheduler() 호출 ~ 데이터를 기다리던 프로세스가 다시 깨어났기 때문

자세한 내용은 Processes2 의 Process Switch 부분 참고 ^__^

 

Ch03 Processes2

Process Structure Process Control Block 1. Process Identification - identifiers : process ID, parent process ID(내 프로그램을 실행시켜준 프로그램), User ID, group ID 2. Processor State Intormation..

comer02.tistory.com

 

Decision Mode

1) Nonpreemptive (비선점형) 스케줄링

: 현재 실행 중인 프로세스가 종료/blocked 되면 다시 스케줄링

- interrupt에 의한 process switch 없음

- 현재 실행 중인 프로세스보다 우선순위가 높은 프로세스가 존재하더라도 종료나 blocked 될 때까지 계속 실행

2) Preemptive (선점형) 스케줄링

: 현재 돌던 프로세스가 종료/blocked, 새 프로세스가 도착, time quantum 소진(0.1초 동안 실행)할 경우 다시 스케줄링

- interrupt에 의한 process switch 가능

- 현재 돌던 프로세스보다 높은 우선순위 프로세그가 도착하거나 time quantum이 소진되자마자 스케줄링

 

 

'Computer > Operating system' 카테고리의 다른 글

09 Uniprocessor Scheduling(2)  (0) 2021.10.26
08 Virtual Memory (2)  (0) 2021.10.25
08 Virtual Memory (1)  (0) 2021.10.25
ch07. Memory Mangement  (0) 2021.10.12
Ch03 Processes2  (0) 2021.09.23