๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ป CS/์šด์˜์ฒด์ œ13

[์šด์˜์ฒด์ œ] 8. Memory Management Logical vs Physical Address 1) Logical Address(virtual address) - ํ”„๋กœ์„ธ์Šค๋งˆ๋‹ค ๋…๋ฆฝ์ ์œผ๋กœ ๊ฐ€์ง€๋Š” ๊ฐ€์ƒ์˜ ์ฃผ์†Œ ๊ณต๊ฐ„ (CPU๊ฐ€ ๋ณด๋Š” ์ฃผ์†Œ) - ๊ฐ ํ”„๋กœ์„ธ์Šค๋งˆ๋‹ค 0๋ฒˆ์ง€๋ถ€ํ„ฐ ์‹œ์ž‘ 2) Physical Address - ๋ฉ”๋ชจ๋ฆฌ์— ์‹ค์ œ ์˜ฌ๋ผ๊ฐ€๋Š” ์œ„์น˜ * ์ฃผ์†Œ ๋ฐ”์ธ๋”ฉ - ํŠน์ • ์‹œ์Šคํ…œ์˜ Logical Addr๋ฅผ Physical Addr๋กœ ๋งคํ•‘ํ•˜๋Š” ๊ฒƒ (Symbolic addr(๋ณ€์ˆ˜/ํ•จ์ˆ˜๋กœ ํ˜ธ์ถœ) -> Logical addr -> Physical addr) ์ฃผ์†Œ ๋ฐ”์ธ๋”ฉ(Address binding) ์ฃผ์†Œ ๋ณ€ํ™˜์ด ์ด๋ฃจ์–ด์ง€๋Š” ์‹œ๊ธฐ์— ๋”ฐ๋ผ ๋ถ„๋ฅ˜ 1) Compile time binding - ์ปดํŒŒ์ผ ์‹œ ์ฃผ์†Œ ๋ณ€ํ™˜(Logical addr์„ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ) -> ๋น„ํšจ์œจ์ ์ด๊ธฐ ๋•Œ๋ฌธ.. 2023. 1. 8.
[์šด์˜์ฒด์ œ] 7. Deadlocks Deadlock Problem 1) Deadlock : ์ผ๋ จ์˜ ํ”„๋กœ์„ธ์Šค๋“ค์ด ์„œ๋กœ๊ฐ€ ๊ฐ€์ง„ SW/HW ์ž์›์„ ๊ธฐ๋‹ค๋ฆฌ๋ฉฐ block๋œ ์ƒํƒœ 2) Resource : HW, SW ๋“ฑ์„ ํฌํ•จํ•˜๋Š” ๊ฐœ๋… - I/O device, CPU cycle, memory space, semaphore ๋“ฑ - ์ž์› ์‚ฌ์šฉ ์ ˆ์ฐจ : Request(์š”์ฒญ) > Allocate(ํ• ๋‹น) > Use(์‚ฌ์šฉ) > Release(๋ฐ˜๋‚ฉ) Deadlock์ด ๋ฐœ์ƒํ•˜๋Š” 4๊ฐ€์ง€ ์กฐ๊ฑด๐Ÿ”ฅ 1) Mutual Exclusion(์ƒํ˜ธ ๋ฐฐ์ œ) : ๋งค ์ˆœ๊ฐ„ ํ•˜๋‚˜์˜ ํ”„๋กœ์„ธ์Šค๋งŒ์ด ์ž์›์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ 2) No preemption(๋น„์„ ์ ) : ํ”„๋กœ์„ธ์Šค๋Š” ์ž์›์„ ์Šค์Šค๋กœ ๋‚ด์–ด๋†“์„ ๋ฟ, ๊ฐ•์ œ๋กœ ๋นผ์•—๊ธฐ์ง€ ์•Š์Œ 3) Hold and wait(๋ณด์œ ๋Œ€๊ธฐ) : ์ž์›์„ ๊ฐ€์ง„ ํ”„๋กœ์„ธ์Šค๊ฐ€ .. 2023. 1. 1.
[์šด์˜์ฒด์ œ] 6. Process Synchronization ๊ณต์œ ๋ฐ์ดํ„ฐ ์ ‘๊ทผ do { entry section critical section exit section remainder section } while (1) ํ”„๋กœ๊ทธ๋žจ์  ํ•ด๊ฒฐ๋ฒ•์˜ ์ถฉ์กฑ ์กฐ๊ฑด 1) Mutual Exclusion(์ƒํ˜ธ ๋ฐฐ์ œ) ํŠน์ • ํ”„๋กœ์„ธ์Šค๊ฐ€ critical section์„ ์ˆ˜ํ–‰ ์ค‘์ด๋ฉด ๋‹ค๋ฅธ ๋ชจ๋“  ํ”„๋กœ์„ธ์Šค๋“ค์€ critical section์— ๋“ค์–ด๊ฐ€๋ฉด ์•ˆ ๋œ๋‹ค 2) Progress ์•„๋ฌด๋„ critical section์— ์žˆ์ง€ ์•Š์€ ์ƒํƒœ์—์„œ critical section์— ๋“ค์–ด๊ฐ€๊ณ ์ž ํ•˜๋Š” ํ”„๋กœ์„ธ์Šค๊ฐ€ ์žˆ๋‹ค๋ฉด critical section์— ๋“ค์–ด๊ฐ€๊ฒŒ ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค. 3) Bounded Waiting(์œ ํ•œ ๋Œ€๊ธฐ) ํ”„๋กœ์„ธ์Šค๊ฐ€ critical section์— ๋“ค์–ด๊ฐ€๋ ค๊ณ  ์š”์ฒญํ•œ ํ›„๋ถ€ํ„ฐ ๊ทธ ์š”์ฒญ์ด ํ—ˆ์šฉ๋  ๋•Œ๊นŒ์ง€.. 2022. 12. 25.
[์šด์˜์ฒด์ œ] 5. CPU Scheduling ํ”„๋กœ์„ธ์Šค์˜ ํŠน์„ฑ ๋ถ„๋ฅ˜ CPU-bound process CPU๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ์„ธ์Šค(high CPU) ๊ณ„์‚ฐ ์œ„์ฃผ์˜ job few very long CPU burst(CPU-intensive) I/O-bound process CPU๋ฅผ ์žก๊ณ  ๊ณ„์‚ฐํ•˜๋Š” ์‹œ๊ฐ„๋ณด๋‹ค I/O์— ๋งŽ์€ ์‹œ๊ฐ„์ด ํ•„์š”ํ•œ process(low CPU) interactive program many short CPU bursts(์ค‘๊ฐ„์— I/O๊ฐ€ ๋ผ์–ด๋“ฆ) CPU-burst Time์˜ ๋ถ„ํฌ ์—ฌ๋Ÿฌ ์ข…๋ฅ˜์˜ job/process์ด ์„ž์—ฌ์žˆ๊ธฐ ๋•Œ๋ฌธ์— CPU ์Šค์ผ€์ค„๋ง์ด ํ•„์š”ํ•˜๋‹ค interactive job(I/O bound job)์—๊ฒŒ ์ ์ ˆํ•œ response๋ฅผ ์šฐ์„ ์ ์œผ๋กœ ์ œ๊ณต CPU์™€ I/O ์žฅ์น˜ ๋“ฑ ์‹œ์Šคํ…œ ์ž์›์„ ๊ณจ๊ณ ๋ฃจ ํšจ์œจ์ ์œผ๋กœ ์‚ฌ์šฉ CPU Schedul.. 2022. 11. 27.