프로그래밍/CS
2023. 11. 5.
공유자원과 교착상태
🔗 정리한 깃허브 주소 (클릭 시 이동) 🧑🤝🧑 공유 자원과 임계 영역 🔎 공유 자원 (Shared Resource) 시스템 안에서 프로세스, 스레드가 함께 접근할 수 있는 자원이나 변수 ex) 모니터, 프린터, 메모리, 파일, 데이터 ... 경쟁 상태 (Race Condition) : 공유 자원을 두개 이상의 프로세스가 동시에 읽거나 쓰는 상황 🔎 임계 영역 (Critical Section) 둘 이상의 프로세스, 스레드가 공유 자원에 접근할 때, 순서 등의 이유로 결과가 달라지는 코드 영역 해결하기 위한 방법은 뮤텍스, 세마포어, 모니터가 있음 상호배제, 한정대기, 융통성 조건 만족 메커니즘 : 잠금(Lock) 💡 임계구역 해결 조건 상호 배제(mutual exclusion) : 한 프로세스가 임계..