Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- Spring
- OAuth 2.0
- java
- synchronized
- 일급 컬렉션
- 일급 객체
- builder
- factory
- Google OAuth
- Dependency Injection
- spring security
- lombok
- Volatile
Archives
- Today
- Total
HJW's IT Blog
CPU Scheduler 본문
Context Switching
Context Switching 이란 CPU를 할당 받고 있던 프로세스 하나를 멈추고 다른 프로세스를 시작하는 것이다.
Context Switching 은 다음 상황에서 발생한다
- Priority Inversion(Process Scheduling)
- Interrupt
- Multitasking
Context Switching 이 일어날때, HW register들은 나중에 복구를 위해 모두 저장된다
Scheduler 종류
Long-Term(Job Scheduler)
- Job들 중 하나를 골라 memory에 load
- Process가 CPU를 떠날때만 실행된다
- Executes Infrequently
- 요즘 컴퓨터는 잘 쓰지 않음
Medium-Term
- 시분할 시스템에선 long-term scheduler의 역할도 한다
- 일시적으로 메모리에서 process를 바꾼다
- Process 를 suspend & resume 할 수 있다
- 목표는 처리율의 균형
Short-Term (CPU-scheduler)
- 자주 실행
- Runs Whenever
- Process 실행
- Running - > Blocked
- Interrupt Occurs
- Ready Process 를 실행/ 자원 할당
- 목표
- 응답시간 최소화
- 평균응답시간 오차 최소
- 처리율 최대화
- Tradeoff - 하나를 개선하면 하나가 나빠짐
'OS' 카테고리의 다른 글
| Process & Thread (0) | 2023.04.08 |
|---|---|
| OS:Cooperating Process (0) | 2023.04.06 |
| Frame Pointer, Stack Pointer (0) | 2023.04.02 |
| OS: Process (0) | 2023.04.02 |
| OS Management + System Call (0) | 2023.04.01 |