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 텐. .









