1 2 3 4 5 6 7 8 Linux
7.1 7.1.1 1
1 2 3
2 3 1 2 3
3
1 2 3
7.1.2 1
2 1 2 3 4 5
7.1.3 1 1
2 3
2 7.1 3
7.1.4 1 1 PCB 2 3
2 PCB PCB PCB PCB PCB
4 1
2 PSW 3
CPU CPU
4 PCB PCB
CPU PCB PCB PCB PCB PCB PCB PCB PCB PCB
7.2 PCB
7 3 PCB.
7.2 7.2.1 PCB
1 2
3 Kernel
7.2.2
7.2.3 1 2
7.2.4 1 2
7.3 7.3.1 1
2
3 Critical Section Entry Section Exit Section
while(true) { entry section critical section exit section remainder section }
4 1 2 3 4
7.3.2 1
2
7.3.3 1 struct semaphore { int value PCB *L }S
2 P V S P V P V Passeren Verhoog Pass Increment
P 1 S.value 1 2 S.value 1 3 S.value 1 L P 7.8
7.8 P
V 1 S.value 1 2 S.value 1 3 S.value 1 L V 7.9
7.9 V
7.3.4 1 2
7.4 Communication Communication
7.4.1 1
2 1 2
3 UNIX pipe pipe
7.4.2 1
2 1 typedefstruct message buffer { } sender // size // text // next //
2 PCB typedefstruct message block { mq // mutex // // 1 sm // 0 }
7.5 7.5.1 1 1
2 3
2 1 2 3 4
7.5.2 1 FCFS FCFS
2 SPF SPF SPF
SPF SPF FCFS SPF
3 HPF HPF
4 CPU CPU CPU CPU
5 1 N N
7.6
7.6.1 1 1 2
2 1 2
3 4 {P1 P1 P2 Pn} P1 P2 P2 P3 P3 Pn P1
4
3 3
1 4
2
3
7.6.2 1
2
3
7.7 7.7.1
Thread Thread
7.7.2 1 2 3 4
7.7.3 1 2 3 4
7.7.4 1 2 3
4 CPU 5 I/O I/O 6 7.14 7.14
7.14
7.8 Linux 7.8.1 Linux 1 Linux 3 7.15 7.15
7.15 Linux
2 Linux Linux 1 task_running 2 3 task_stopped 4 task_zombie
7.16 Linux
7.8.3 Linux Linux 7.8.4 Linux Linux 1 2 3 4. 5.