CS/โ๏ธ ์ด์์ฒด์
์ปค๋์ ์ง์ ํ์ โจ IPC์ ๋ชฉ์ = ํ๋ก์ธ์ค ๋๊ธฐํ data transfer sharing data event notification resource sharing and synchronization process control Message Passing ์ปค๋์ ํตํด ์ฃผ๊ณ ๋ฐ์ user ๊ณ์ธต์ ์๋ ํ๋ก์ธ์ค๋ค๋ผ๋ฆฌ ์ง์ ํต์ X ๐ OS์์ ์ ๊ณตํ๋ message passing์ ๊ดํ system call์ ์ด์ฉํด ์ปค๋์ ๊ฑฐ์ณ๊ฐ Messsage queue Pipes Mailboxes Sockets communication link๋ฅผ ๋ง๋ค์ด์ ๋ฉ์์ง๋ฅผ ์ฃผ๊ณ ๋ฐ์ ๐น Direct Communication ํ๋ก์ธ์ค๋ฅผ ์ง์ ์ง๋ช
send(P, message) receive(Q, message) ์๋๋ฐฉ์ I..
CS/โ๏ธ ์ด์์ฒด์
ํ๋ก์ธ์ค ๋๊ธฐํ ์ฌ๋ฌ ํ๋ก์ธ์ค๊ฐ ๊ณต์ ์์์ ์ ๊ทผํ๋ค๋ฉด race condition(๊ฒฝํฉ์กฐ๊ฑด)์ด ๋ฐ์ํ๋ค. ์ด๋ฌํ ์ํฉ์ ๋ง๊ธฐ ์ํด์ ํ์ํ mechanism์ด ์๋ค. ๐น Locking Mechanism ์ด๋ค ์์
์ด ์ํ๋๋ ๊ฒ์ ๋ง๋๋ค ๐ before entering critical section ๐ before accessing shared data critical section(์๊ณ์์ญ)์ ์ต๋ํ ์งง๊ฒ ์ค์ ํด์ผํ๋ค multi-processors์์ interrupt-based locks์ ๊ตฌํํ๊ธฐ ์ด๋ ค์ ๐ read-write instructions ์ผ๋ก ํด๊ฒฐ ๐น Semaphore Synchronization tool Counting semaphore Binary semaphore โ 0 ๋๋ 1 ๊ฐ๋ง..
CS/โ๏ธ ์ด์์ฒด์
CPU ์ค์ผ์ค๋ง ๐ ์ด๋ ํ๋ก์ธ์ค๊ฐ ์ฌ์ฉ๋ ๊ฒ์ธ์ง ๊ฒฐ์ ๐น CPU ์ค์ผ์ค๋ฌ Ready ์ํ์ ํ๋ก์ธ์ค ์ค์์ ์ด๋ฒ์ CPU์ ์ค ํ๋ก์ธ์ค ์ ์ ๐น Dispatcher CPU ์ ์ด๊ถ์ CPU ์ค์ผ์ค๋ฌ์ ์ํด ์ ํ๋ ํ๋ก์ธ์ค์๊ฒ ๋๊น = context switching ๐น ๊ณ ๋ ค์ฌํญ ๋๊ตฌํํ
CPU๋ฅผ ์ค ๊ฒ์ธ์ง ์ค๊ฐ์ CPU๋ฅผ ๋บ์ด์ฌ ์ ์๊ฒ ํ ๊ฒ์ธ์ง ๋๋ ๊ณ์ ์ฐ๊ฒ ํ ๊ฒ์ธ์ง ๐น scheduling criteria CPU utilization โ ์ต๋ํ ์ฌ์ฉ Throughput Turnaround Time (์ด ์์์๊ฐ) Waiting Time Response time (CPU๋ฅผ ์ต์ด ์ป์ ๋๊น์ง ๊ฑธ๋ฆฐ ์๊ฐ) ์ค์ผ์ค๋ง ์๊ณ ๋ฆฌ์ฆ ๐น nonpreemptive (๋น์ ์ ํ) ๐น preemptive (์ ์ ํ) ๐ธ ..
CS/โ๏ธ ์ด์์ฒด์
์ค๋ ๋ ์ค๋ ๋ ํ๋ก์ธ์ค ๋ด๋ถ์ ์์. ํ ๊ฐ์ ํ๋ก์ธ์ค๊ฐ ์ฌ๋ฌ ์ค๋ ๋๋ฅผ ๊ฐ์ง ์ ์์ โก๏ธ 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 ove..
CS/โ๏ธ ์ด์์ฒด์
ํ๋ก์ธ์ค ๐น ํ๋ก์ธ์ค ์ฝ๋์ ์ผ๋ถ. ์คํ ์ค์ธ ํ๋ก๊ทธ๋จ ์๊ธฐ ๋
๋ฆฝ์ ์ธ resource ๊ฐ์ง. single address space โก๏ธ protection ๋ค๋ฅธ ํ๋ก์ธ์ค์ ๊ณต์ X ๐น ํน์ง ํ๋ก์ธ์ค ๊ฐ๊ฐ ๊ณ ์ ์ ์คํ ๋ฉ๋ชจ๋ฆฌ ๋ณด์ ๊ณ ์ ์ ๋ฉ๋ชจ๋ฆฌ ํ์ด์ง ๋ณด์ ๊ณ ์ ์ file descriptor table ๋ณด์ PID (Process ID) ๐น ํ๋ก์ธ์ค์ Context CPU ์ํ ์ํ๋ฅผ ๋ํ๋ด๋ ํ๋์จ์ด ๋ฌธ๋งฅ Program Counter register ํ๋ก์ธ์ค ์ฃผ์ ๊ณต๊ฐ code data stack ํ๋ก์ธ์ค ๊ด๋ จ ์ปค๋ ์๋ฃ๊ตฌ์กฐ PCB Kernel Stack ๐น ํ๋ก์ธ์ค ์์ฑ ์์์ ๋ถ๋ชจ์ ๊ณต๊ฐ์ ๋ณต์ฌํด ๊ทธ ๊ณต๊ฐ์ ์๋ก์ด ํ๋ก๊ทธ๋จ์ ์ฌ๋ฆผ ํธ๋ฆฌ(๊ณ์ธต ๊ตฌ์กฐ) ํ์ฑ fork() ์์คํ
์ฝ์ ํตํด ์์ ๊ณผ ๋์ผํ ํ๋ก..