Skip to content

Commit

Permalink
Merge pull request #38 from Seogeurim/OS/Seogeurim
Browse files Browse the repository at this point in the history
OperatingSystem/seogeurim
  • Loading branch information
ggjae authored May 25, 2021
2 parents 7e2da52 + e8cb45a commit 0ea4ce6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions contents/operating-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ Context-Switching ์ด๋ž€, **CPU ์ฝ”์–ด๋ฅผ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๋กœ ์ „ํ™˜ํ•˜๊ธฐ
- ๋ฉ€ํ‹ฐ ํ”„๋กœ๊ทธ๋ž˜๋ฐ (multiprogramming) : CPU ์‚ฌ์šฉ๋ฅ ์„ ์ตœ๋Œ€ํ™”ํ•˜๊ธฐ ์œ„ํ•ด ํ•ญ์ƒ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹คํ–‰ํ•˜๋„๋ก ํ•œ๋‹ค. ์–ด๋–ค ํ”„๋กœ์„ธ์Šค๊ฐ€ CPU๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๊ฐ€ I/O ์ž‘์—… ๋“ฑ CPU๋ฅผ ํ•„์š”๋กœ ํ•˜์ง€ ์•Š๋Š” ์ˆœ๊ฐ„์ด ์˜ค๋ฉด ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๊ฐ€ CPU๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•œ๋‹ค.
- ์‹œ๋ถ„ํ•  (time sharing) : ๊ฐ ํ”„๋กœ๊ทธ๋žจ์ด ์‹คํ–‰๋˜๋Š” ๋™์•ˆ ์‚ฌ์šฉ์ž๋“ค์ด ์ƒํ˜ธ์ž‘์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ”„๋กœ์„ธ์Šค ๊ฐ„ CPU ์ฝ”์–ด๋ฅผ ์ž์ฃผ ์ „ํ™˜ํ•˜๋Š” ๊ฒƒ์ด๋‹ค. CPU๊ฐ€ ํ•˜๋‚˜์˜ ํ”„๋กœ๊ทธ๋žจ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์‹œ๊ฐ„์„ ๋งค์šฐ ์งง์€ ์‹œ๊ฐ„(ms)์œผ๋กœ ์ œํ•œํ•˜์—ฌ ํ”„๋กœ๊ทธ๋žจ์„ ๋ฒˆ๊ฐˆ์•„ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ•˜๋ฉด CPU๊ฐ€ ํ•˜๋‚˜์ธ ํ™˜๊ฒฝ์—์„œ๋„ ์—ฌ๋Ÿฌ ์‚ฌ์šฉ์ž๊ฐ€ ๋™์‹œ์— ์‚ฌ์šฉํ•˜๋Š” ๋“ฏํ•œ ํšจ๊ณผ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค.

### ํ”„๋กœ์„ธ์Šค ์ƒํƒœ

![image](materials/process-state-diagram.png)

- **New** : ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ƒ์„ฑ๋จ
- **Running** : ํ”„๋กœ์„ธ์Šค์˜ Instruction์ด ์‹คํ–‰๋จ
- **Waiting** : (I/O ์ž‘์—… ์™„๋ฃŒ๋‚˜ ์‹ ํ˜ธ ์ˆ˜์‹ ๊ณผ ๊ฐ™์€) ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๊ธฐ๋ฅผ ๊ธฐ๋‹ค๋ฆผ
- **Ready** : ํ”„๋กœ์„ธ์„œ์— ํ• ๋‹น๋˜๊ธฐ๋ฅผ ๊ธฐ๋‹ค๋ฆผ
- **Terminated** : ํ”„๋กœ์„ธ์Šค๊ฐ€ ์‹คํ–‰์„ ๋๋ƒ„

### ์Šค์ผ€์ค„๋ง ํ

#### Ready Queue
Expand All @@ -171,7 +181,67 @@ Context-Switching ์ด๋ž€, **CPU ์ฝ”์–ด๋ฅผ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๋กœ ์ „ํ™˜ํ•˜๊ธฐ
## CPU ์Šค์ผ€์ค„๋ง

> ๋‚ด์šฉ ์ถ”๊ฐ€ ์˜ˆ์ •
CPU ์Šค์ผ€์ค„๋ง์€ Ready Queue์— ์žˆ๋Š” ํ”„๋กœ์„ธ์Šค๋“ค์„ ๋Œ€์ƒ์œผ๋กœ ์ด๋ฃจ์–ด์ง„๋‹ค.

### ์„ ์  / ๋น„์„ ์  ์Šค์ผ€์ค„๋ง (Preemptive and Non-preemptive Scheduling)

CPU ์Šค์ผ€์ค„๋ง์€ ๋‹ค์Œ์˜ 4๊ฐ€์ง€ ์ƒํ™ฉ์— ๋Œ€ํ•˜์—ฌ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.

1. ํ”„๋กœ์„ธ์Šค๊ฐ€ running โ†’ waiting ์ƒํƒœ๋กœ ์ „ํ™˜ (ex. I/O ์š”์ฒญ ๋˜๋Š” ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค ์ข…๋ฃŒ๋ฅผ ์œ„ํ•œ wait() ํ˜ธ์ถœ)
2. ํ”„๋กœ์„ธ์Šค๊ฐ€ running โ†’ ready ์ƒํƒœ๋กœ ์ „ํ™˜ (ex. interrupt ๋ฐœ์ƒ)
3. ํ”„๋กœ์„ธ์Šค๊ฐ€ waiting โ†’ ready ์ƒํƒœ๋กœ ์ „ํ™˜ (ex. I/O ์™„๋ฃŒ)
4. ํ”„๋กœ์„ธ์Šค ์ข…๋ฃŒ

์Šค์ผ€์ค„๋ง ์‹œ ์ƒํ™ฉ 1, 4์—์„œ๋Š” ์„ ํƒ๊ถŒ ์—†์ด ์ƒˆ ํ”„๋กœ์„ธ์Šค๋ฅผ ์„ ํƒํ•ด์•ผ ํ•œ๋‹ค. ํ•˜์ง€๋งŒ ์ƒํ™ฉ 2, 3์—์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์„ ํƒ๊ถŒ์ด ์žˆ๋‹ค.

- **๋น„์„ ์  ์Šค์ผ€์ค„๋ง** : CPU๊ฐ€ ํ• ๋‹น๋œ ์–ด๋–ค ํ”„๋กœ์„ธ์Šค๋Š” ์ข…๋ฃŒ / waiting ์ƒํƒœ๋กœ ์ „ํ™˜ํ•˜์—ฌ CPU๋ฅผ ํ•ด์ œํ•  ๋•Œ๊นŒ์ง€ CPU๋ฅผ ์œ ์ง€ํ•˜๊ณ , ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๋Š” ๊ทธ ๋•Œ๊นŒ์ง€ CPU๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค.
- **์„ ์  ์Šค์ผ€์ค„๋ง** : ์–ด๋–ค ํ”„๋กœ์„ธ์Šค๊ฐ€ CPU๋ฅผ ์ ์œ ํ•˜๊ณ  ์žˆ์„ ๋•Œ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๊ฐ€ CPU๋ฅผ ์„ ์ ํ•  ์ˆ˜ ์žˆ๋‹ค. Windows, macOS, Linux ๋ฐ UNIX๋ฅผ ํฌํ•จํ•œ ๊ฑฐ์˜ ๋ชจ๋“  ์ตœ์‹  ์šด์˜์ฒด์ œ๋Š” ์„ ์  ์Šค์ผ€์ค„๋ง ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•œ๋‹ค.

### ์Šค์ผ€์ค„๋ง ์•Œ๊ณ ๋ฆฌ์ฆ˜

#### FCFS (First-Come, First-Served) Scheduling

- **๋น„์„ ์  ์Šค์ผ€์ค„๋ง**
- ๋จผ์ € CPU๋ฅผ ์š”์ฒญํ•˜๋Š” ํ”„๋กœ์„ธ์Šค์— ๋จผ์ € CPU๊ฐ€ ํ• ๋‹น๋œ๋‹ค.
- FIFO queue ๋ฅผ ์‚ฌ์šฉํ•ด ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค.
- ๋ฌธ์ œ์ ) **convoy effect** : ๋จผ์ € ๋“ค์–ด์˜จ ์–ด๋–ค ํ”„๋กœ์„ธ์Šค์˜ CPU ์ฒ˜๋ฆฌ ์‹œ๊ฐ„์ด ๊ธธ ๊ฒฝ์šฐ ๋‹ค๋ฅธ ๋ชจ๋“  ํ”„๋กœ์„ธ์Šค๋“ค์ด ๊ธฐ๋‹ค๋ฆผ์œผ๋กœ์„œ ๋” ์งง์€ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋จผ์ € ์ง„ํ–‰๋  ์ˆ˜ ์žˆ๋Š” ๊ฒฝ์šฐ๋ณด๋‹ค CPU ๋ฐ ์žฅ์น˜ ์‚ฌ์šฉ๋ฅ ์ด ๋‚ฎ์•„์ง€๋Š” ํ˜„์ƒ

#### SJF (Shortest-Job-First) Scheduling

- **๋น„์„ ์  ์Šค์ผ€์ค„๋ง ๋ฐฉ์‹** : CPU burst time์ด ๊ฐ€์žฅ ์ž‘์€ ํ”„๋กœ์„ธ์Šค์—๊ฒŒ ๋จผ์ € CPU๋ฅผ ํ• ๋‹นํ•œ๋‹ค. ๋งŒ์ผ CPU burst time์ด ๊ฐ™๋‹ค๋ฉด, FCFS ๋ฐฉ์‹์„ ์ ์šฉํ•œ๋‹ค.
- **์„ ์  ์Šค์ผ€์ค„๋ง ๋ฐฉ์‹ (SRTF (Shortest-Remaining-Time-First) Scheduling)** : ์ƒˆ๋กœ ๋“ค์–ด์˜จ ํ”„๋กœ์„ธ์Šค์˜ CPU burst time์ด ํ˜„์žฌ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ๋‚จ์€ burst time ๋ณด๋‹ค ์ž‘๋‹ค๋ฉด ํ˜„์žฌ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ƒˆ๋กœ ๋“ค์–ด์˜จ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์„ ์ ํ•œ๋‹ค.
- [Priority Scheduling](#priority-scheduling)์˜ ํ•œ ์˜ˆ์ด๋‹ค. (์šฐ์„ ์ˆœ์œ„ = CPU burst time)
- ์ฃผ์–ด์ง„ ํ”„๋กœ์„ธ์Šค ์ง‘ํ•ฉ์— ๋Œ€ํ•ด **์ตœ์†Œ ํ‰๊ท  ๋Œ€๊ธฐ ์‹œ๊ฐ„**์„ ์ œ๊ณตํ•œ๋‹ค๋Š” ์ ์—์„œ ์ตœ์ ์˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด๋‹ค. ํ•˜์ง€๋งŒ CPU burst time์„ ์•Œ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด ์—†๊ธฐ ๋•Œ๋ฌธ์— CPU ์Šค์ผ€์ค„๋ง ์ˆ˜์ค€์—์„œ ๊ตฌํ˜„ํ•  ์ˆ˜ ์—†๋‹ค. ์ด์— ๋Œ€ํ•œ ํ•œ ๊ฐ€์ง€ ์ ‘๊ทผ ๋ฐฉ์‹์€ SJF ์Šค์ผ€์ค„๋ง์„ ๊ทผ์‚ฌํ™”ํ•˜๋Š” ๊ฒƒ์ด๋ฉฐ, ์ด์ „ CPU burst time ์ง€์ˆ˜ ํ‰๊ท ์œผ๋กœ ์˜ˆ์ธกํ•  ์ˆ˜ ์žˆ๋‹ค.
- ๋ฌธ์ œ์ ) **starvation** : CPU ์ฒ˜๋ฆฌ ์‹œ๊ฐ„์ด ๊ธด ํ”„๋กœ์„ธ์Šค๋Š” ๊ณ„์† Ready Queue์˜ ๋’ค๋กœ ๋ฐ€๋ ค๋‚˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฌดํ•œ์ • ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.

#### RR (Round-Robin) Scheduling

- **์„ ์  ์Šค์ผ€์ค„๋ง**
- ๊ฐ ํ”„๋กœ์„ธ์Šค๋Š” **time quantum (or time slice)** ์ด๋ผ๋Š” ์ž‘์€ ์‹œ๊ฐ„ ๋‹จ์œ„(10-100ms)๋ฅผ ๊ฐ–๊ฒŒ ๋œ๋‹ค. ํ”„๋กœ์„ธ์Šค๋Š” 1 time quantum ๋™์•ˆ ์Šค์ผ€์ค„๋Ÿฌ์— ์˜ํ•ด CPU๋ฅผ ํ• ๋‹น ๋ฐ›๊ณ , ์‹œ๊ฐ„์ด ๋๋‚˜๋ฉด interrupt๋ฅผ ๋ฐ›์•„ Ready Queue์˜ tail์— ๋ฐฐ์น˜๋œ๋‹ค.
- Ready Queue๋Š” Circular FIFO queue ํ˜•ํƒœ์ด๋‹ค.
- RR์˜ ํ‰๊ท  ๋Œ€๊ธฐ ์‹œ๊ฐ„์€ ๊ธด ํŽธ์ด๋‹ค. ํ•˜์ง€๋งŒ ๊ณต์ •ํ•˜๋‹ค. `n`๊ฐœ์˜ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์žˆ๊ณ  time quantum์ด `q`์ผ ๋•Œ, ์–ด๋–ค ํ”„๋กœ์„ธ์Šค๋„ `(n-1) x q` ์‹œ๊ฐ„ ๋‹จ์œ„ ์ด์ƒ ๊ธฐ๋‹ค๋ฆฌ์ง€ ์•Š๋Š”๋‹ค.

Time quantum ์„ค์ • ์‹œ ์ฃผ์˜ํ•  ์ 

- Time quantum์ด ๋„ˆ๋ฌด ํฌ๋‹ค๋ฉด : FCFS์™€ ๊ฐ™์•„์ง„๋‹ค.
- Time quantum์ด ๋„ˆ๋ฌด ์ž‘๋‹ค๋ฉด : Context Switching์ด ๋„ˆ๋ฌด ๋นˆ๋ฒˆํ•˜๊ฒŒ ์ผ์–ด๋‚˜ overhead๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

์œ„์™€ ๊ฐ™์ด RR ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์„ฑ๋Šฅ์€ time quantum์˜ ํฌ๊ธฐ์— ์ขŒ์šฐ๋  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ ์ ˆํžˆ ์„ ์ •ํ•ด์•ผ ํ•˜๋ฉฐ ์ด๋Š” context-switch time๋ณด๋‹ค ํฐ ๊ฒƒ์ด ์ข‹์ง€๋งŒ ๋˜ ๋„ˆ๋ฌด ์ปค์„œ๋Š” ์•ˆ ๋œ๋‹ค. (๊ฒฝํ—˜์ ์œผ๋กœ CPU burst์˜ 80ํ”„๋กœ๋Š” time quantum๋ณด๋‹ค ์งง์€๊ฒŒ ์ข‹๋‹ค๊ณ  ํ•จ)

#### Priority Scheduling

- ์ •์ˆ˜๋กœ ํ‘œํ˜„๋œ ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋” ๋†’์€ ํ”„๋กœ์„ธ์Šค์—๊ฒŒ CPU๋ฅผ ํ• ๋‹นํ•˜๋Š” ์Šค์ผ€์ค„๋ง์ด๋‹ค. ์šฐ์„ ์ˆœ์œ„๋Š” ๋‚ด๋ถ€์ /์™ธ๋ถ€์ ์œผ๋กœ ์ •์˜ํ•  ์ˆ˜ ์žˆ๋‹ค.
- ๋‚ด๋ถ€์  : ์‹œ๊ฐ„ ์ œํ•œ, ๋ฉ”๋ชจ๋ฆฌ ์š”๊ตฌ ์‚ฌํ•ญ, ์—ด๋ฆฐ ํŒŒ์ผ ์ˆ˜, ํ‰๊ท  I/O burst ๋Œ€ ํ‰๊ท  CPU burst ๋น„์œจ ๋“ฑ ์ธก์ • ๊ฐ€๋Šฅํ•œ ์ˆ˜๋Ÿ‰ ์‚ฌ์šฉํ•ด ๊ณ„์‚ฐ
- ์™ธ๋ถ€์  : ํ”„๋กœ์„ธ์Šค์˜ ์ค‘์š”์„ฑ, ์ปดํ“จํ„ฐ ์‚ฌ์šฉ์— ๋Œ€ํ•ด ์ง€๋ถˆ๋˜๋Š” ์ž๊ธˆ์˜ ์œ ํ˜• ๋ฐ ๊ธˆ์•ก, ์ž‘์—…์„ ํ›„์›ํ•˜๋Š” ๋ถ€์„œ, ๊ธฐํƒ€ ์ •์น˜์  ์š”์ธ ๋“ฑ
- **์„ ์  / ๋น„์„ ์  ์Šค์ผ€์ค„๋ง** ๋ชจ๋‘ ๊ฐ€๋Šฅํ•˜๋‹ค.
- ์„ ์  ๋ฐฉ์‹ : ์ƒˆ๋กœ ๋„์ฐฉํ•œ ํ”„๋กœ์„ธ์Šค์˜ ์šฐ์„  ์ˆœ์œ„๊ฐ€ ํ˜„์žฌ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์šฐ์„  ์ˆœ์œ„๋ณด๋‹ค ๋†’์œผ๋ฉด CPU ์„ ์ 
- ๋น„์„ ์  ๋ฐฉ์‹ : ๊ฐ™์€ ๊ฒฝ์šฐ ๋‹จ์ˆœํžˆ ์ƒˆ ํ”„๋กœ์„ธ์Šค๋ฅผ Ready Queue์˜ ๋งจ ์•ž์— ๋‘”๋‹ค.
- ๋ฌธ์ œ์ ) **indefinite blocking**, **starvation**
- ์‹คํ–‰ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์œผ๋‚˜ CPU๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋Š” ํ”„๋กœ์„ธ์Šค๋Š” block๋œ ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผ๋  ์ˆ˜ ์žˆ๋‹ค.
- ์šฐ์„  ์ˆœ์œ„๊ฐ€ ๋‚ฎ์€ ์ผ๋ถ€ ํ”„๋กœ์„ธ์Šค๋Š” ๋ฌด๊ธฐํ•œ ๋Œ€๊ธฐ ์ƒํƒœ๊ฐ€ ๋  ์ˆ˜ ์žˆ๋‹ค.
- ํ•ด๊ฒฐ ๋ฐฉ์•ˆ) **Aging**, **Round-Robin๊ณผ ๊ฒฐํ•ฉ**
- Aging : ์˜ค๋žซ๋™์•ˆ ๋Œ€๊ธฐํ•˜๋Š” ํ”„๋กœ์„ธ์Šค์˜ ์šฐ์„ ์ˆœ์œ„๋ฅผ ์ ์ง„์ ์œผ๋กœ ๋†’์ด๋Š” ๋ฐฉ์‹์œผ๋กœ ๋ฌธ์ œ์ ์„ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋Œ€๊ธฐ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์šฐ์„ ์ˆœ์œ„๋ฅผ ๋งค์ดˆ ๋Š˜๋ฆฌ๋Š” ๊ฒƒ์ด๋‹ค.
- RR+PS : ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๊ฐ€์žฅ ๋†’์€ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹คํ–‰ํ•˜๋Š”๋ฐ, ๋™์ผํ•œ ์šฐ์„ ์ˆœ์œ„์˜ ํ”„๋กœ์„ธ์Šค์— ๋Œ€ํ•ด์„œ๋Š” Round-Robin ์Šค์ผ€์ค„๋ง์„ ์ ์šฉํ•œ๋‹ค.

---

Expand Down Expand Up @@ -765,10 +835,12 @@ Page fault
</details>
<details>
<summary>๋ฆฌ๋ˆ…์Šค ์šด์˜์ฒด์ œ์—์„œ๋Š” ์–ด๋–ค ํŽ˜์ด์ง€ ๊ต์ฒด ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ• ๊นŒ์š”? ์ž์‹ ์ด์ƒ๊ฐํ•˜๋Š”์ด์œ ์™€ ํ•จ๊ป˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”.</summary>
<summary>๋ฆฌ๋ˆ…์Šค ์šด์˜์ฒด์ œ์—์„œ๋Š” ์–ด๋–ค ํŽ˜์ด์ง€ ๊ต์ฒด ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ• ๊นŒ์š”? ์ž์‹ ์ด ์ƒ๊ฐํ•˜๋Š” ์ด์œ ์™€ ํ•จ๊ป˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”.</summary>
<p>
LRU๋ฅผ ์‚ฌ์šฉํ•จ. OPR์— ๊ทผ์‚ฌํ•˜๊ณ  ํ˜„์‹ค์ ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆœ ์—†๊ธฐ ๋•Œ๋ฌธ์— ์ตœ์  ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ๊ฐ€์žฅ ๊ทผ์‚ฌํ•œ LRU์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ด๋‹ค.
LRU(Least Recently Used Algorithm)๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
OPR(Optimal Page Replacement)์ด ์ œ์ผ ์ด์ƒ์ ์ด์ง€๋งŒ OPR์€ ์ด๋ก ์ƒ์—์„œ๋งŒ ๊ฐ€๋Šฅํ•˜๊ณ  ํ˜„์‹ค์—์„œ๋Š” ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— OPR์— ๊ฐ€์žฅ ๊ทผ์‚ฌํ•œ LRU์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
LRU๋Š” ๊ฐ€์žฅ ์˜ค๋žซ๋™์•ˆ ์ฐธ์กฐ๋˜์ง€ ์•Š์€ ํŽ˜์ด์ง€๋ฅผ ๊ต์ฒดํ•˜๋Š” ๊ธฐ๋ฒ•์œผ๋กœ ์˜ค๋ฒ„ํ—ค๋“œ๊ฐ€ ํฐ ๊ฒƒ์ด ๋‹จ์ ์ด์ง€๋งŒ ๋‹ค๋ฅธ ํŽ˜์ด์ง€ ๊ต์ฒด ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ๋น„ํ•˜์—ฌ ์ œ์ผ ์ด์ƒ์ ์ž…๋‹ˆ๋‹ค.
</p>
</details>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ea4ce6

Please sign in to comment.