본문 바로가기
TIL (Today I Learned)/컴퓨터 시스템(CS)

[CS] Process Synchronization and Mutual Exclusion #2

by 둥굴프 2022. 12. 16.
이 포스팅은 한국기술교육대학교 김덕수 교수님의 운영체제 강의를 참고하여 작성되었습니다.

 

Mutual Exclusion Solutions

SW solutions
• Dekker’s algorithm (Peterson’s algorithm)
• Dijkstra’s algorithm, Knuth’s algorithm, Eisenberg and McGuire’s algorithm, Lamport’s algorithm

HW solution
• TestAndSet (TAS) instruction

OS supported SW solution
• Spinlock
• Semaphore
• Eventcount/sequencer

Language-Level solution
• Monitor

 

 

Synchronization Hardware

TestAndSet (TAS) instruction

Trst와 Set을 한 번에 수행하는 기계어

Machine instruction

- 실행 중 interrupt를 받지 않음 (preemption 되지 않음)

3개 이상의 프로세스의 경우, Bounded waiting조건 위배

 

N-Process mutual exclusion

김덕수 교수님 운영 체제 강의자료 中

 

 

H/W Solution

 

장점

- 구현이 간단

 

단점

- Busy waiting / Inefficient

 

Busy waiting 문제를 해소한 상호 배제 기법

- Semaphore : 대부분의 OS들이 사용하는 기법

 

 

긴 글 읽어주셔서 감사드립니다.

22.12.16

댓글