process scheduling 게 .
1. real-time process - 1.hard real-time(), 2.soft real-time(vedio decoder )
2. time-sharing process
1. real-time process - 1.hard real-time(), 2.soft real-time(vedio decoder )
2. time-sharing process
기 time-sharing .
Linux 게 thread .
1. Kernel - 1. Kernel Thread, 2. LWT(Lightweight Thread)
2. User Thread
Linux 게 thread .
1. Kernel - 1. Kernel Thread, 2. LWT(Lightweight Thread)
2. User Thread
thread 기, context switch thread 게.
Linux 개 fork() do_fork() Kernel , do_fork() user thread POSIX기 Mutex .
Linux 개 fork() do_fork() Kernel , do_fork() user thread POSIX기 Mutex .
... 그고... ... POSIX thread thread 기 .
계 . 계 . .
... mutex 기... 겠군... lock 걸 기 context switch 거.
계 . 계 . .
... mutex 기... 겠군... lock 걸 기 context switch 거.
... context switch PCB(Process Control Block) .
Assembly 그 .
PCB process간 .
-> Zombie Process PCB 값 .
Assembly 그 .
PCB process간 .
-> Zombie Process PCB 값 .
~cpp
void *thread(void *arg)
{
int num = *(int *)arg;
int i;
for(i=1; i<=20; i++){
pthread_mutex_lock(&mutex);
printf("%d: sum+=%d\n", num, i);
sum += i;
sleep(1);
pthread_mutex_unlock(&mutex);
}
}
thread 10개 고 ,
고 context switch 고 arg .
arg 0~9까 게 .
pthread_mutex_lock 걸 arg 0 게.
까 각 pthread .
기까 arg 값 . .
Critical Section .
. 간 고
argument 겨 .
function argument 기 stack 계 고, 개개 각각 stack 고 . 각.
. 간 고
argument 겨 .
function argument 기 stack 계 고, 개개 각각 stack 고 . 각.









