์ค๋ ๋
- ์ค๋ ๋
- ํ๋ก์ธ์ค ๋ด๋ถ์ ์์.
- ํ ๊ฐ์ ํ๋ก์ธ์ค๊ฐ ์ฌ๋ฌ ์ค๋ ๋๋ฅผ ๊ฐ์ง ์ ์์ โก๏ธ concurrency ๋ณ๋ ฌ์ฒ๋ฆฌ
- ์ค๋ ๋๋ผ๋ฆฌ address space, resource ๊ณต์
- ๋ฉํฐ ์ค๋ ๋
- modern OS
- embedded systems
- multi-core processors
- network servers
๐น Multiple Threads
- ๊ฐ thread๋ ๋ณ๊ฐ๋ก ์คํ
- Memory์ I/O state์ ๊ณต์
- thread 1์์ thread 2๋ก context switching์ด ์ผ์ด๋๋ฉด thread1์ด ๊ฐ์ง๊ณ ์๋ register set์ CPU state์ ์ ์ฅ
- thread2์ CPU state์ register set์ load
- Hyper-Threading : Context switching overhead โฌ๏ธ
๐น TCB (Thread Control Block)
- thread in a process shares
- code section
- data section โ content of memory (global variables, heap)
- I/O state (file system, network connections, etc)
- thread ๊ณ ์
- TCB
- CPU registers including PC
- register set
- Stack
- stack
- temporary (local) ๋ณ์
- function parameter
- return address in function calls
๐น thread์ ์ฅ์
- Responsiveness (์๋ต์ฑ) :
- ์น๋ธ๋ผ์ฐ์ ๋ฅผ ์ฌ๋ฌ ๊ฐ์ ์ค๋ ๋๋ก ๋ง๋ฆ
- HTML๋ฌธ์๋ฅผ ๊ฐ์ ธ์์ ์ด๋ฏธ์ง ํ์ผ ๋ฑ์ ์น์๋ฒ์ ์์ฒญ
- ์ฌ๋ฌ ๊ฐ์ ์ค๋ ๋ ์ค ๋คํธ์ํฌ๋ฅผ ์์ฒญํ ์ค๋ ๋๋ง block๋๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ์ค๋ ๋๊ฐ ์ด๋ฏธ ์ฝ์ด์จ html ๋ฌธ์๋ผ๋ ๋จผ์ ๋ณด์ฌ์ค
- ์ฌ์ฉ์ ์ ์ฅ์์๋ ๋ต๋ตํจ ๊ทธ๋๋ง ํด์
- Resource Sharing : ๋๊ฐ์ ์ผ์ ํ๋ ํ๋ก๊ทธ๋จ โ share binary code, data, resource of the process
- Economy : ์ค๋ฒํค๋ โฌ๏ธ
- Utilization of MP(Multi Processor) Architectures : ๊ฐ๊ฐ์ ์ค๋ ๋๊ฐ ์๋ก ๋ค๋ฅธ processor์์ ๋ณ๋ ฌ์ ์ผ๋ก ์ผ์ ํ ์ ์์
๐น Concurrency Problem
- ์ฌ๋ฌ ๊ฐ์ ํ๋ก์ธ์ค ๋๋ ์ค๋ ๋๊ฐ ์คํ๋ ๋ โ Synchronization : to ensure cooperation between threads using atomic operation
- atomic operation : ์ค๊ฐ์ ๋ฉ์ถ๊ฑฐ๋ ์์ ๋ถ๊ฐ
'CS > โ๏ธ ์ด์์ฒด์ ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[โ๏ธ OS] ํ๋ก์ธ์ค ๊ฐ ํต์ (IPC: Inter-Process Communication) (0) | 2024.03.09 |
---|---|
[โ๏ธ OS] ํ๋ก์ธ์ค ๋๊ธฐํ (0) | 2024.03.09 |
[โ๏ธ OS] CPU ์ค์ผ์ค๋ง (1) | 2024.03.03 |
[โ๏ธ OS] Process (1) | 2024.02.27 |