Mutual Exclusion

esmin·2021년 1월 29일

pintos

목록 보기
2/6

강의자료

https://www.youtube.com/watch?v=lY43KR3IItw&list=PLBrGAFAIyf5rby7QylRc6JxU5lzQ9c4tN&index=13&ab_channel=HPCLab.KOREATECH


목차


용어

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


TAS는 하드웨어, OS가 지원하면 busy waiting 문제가 사라진다.



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 다익스트라 알고리즘


SW Mutual Exclution

spinlock은 busy waiting 문제 존재, 멀티코어에서만 사용 가능


반면 Semaphore는 busy waiting이 없다.
P, V 똑같이 사용한다



세마포어: 창고의 물건이라고 생각하자!

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


Semaphore의 Wake One of them 문제를 해결하기 위한 Sequencer

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


language level Solution


mutaul exclusion을 언어가 보장해준다

아래와같이 모니터는 간단하다

0개의 댓글