
critical section: 공통으로 접근하는 공간


In computing, preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task at a later time. Such changes of the executed task are known as context switches. They are normally carried out by a privileged task or part of the system known as a preemptive scheduler, which has the power to preempt, or interrupt, and later resume, other tasks in the system.
N개 Mutual Exclusion 다익스트라 알고리즘



spinlock은 busy waiting 문제 존재, 멀티코어에서만 사용 가능
반면 Semaphore는 busy waiting이 없다.
P, V 똑같이 사용한다





P: 물건 가져가기, 문 잠그기 등
V: 물건 가져가면서 공간 +1하기, 문 열기 등

은행에서 업무보는 것과 상당히 유사하다
Starvation 문제가 해결된다.






mutaul exclusion을 언어가 보장해준다
아래와같이 모니터는 간단하다



