-
공유자원, 임계구역 / 임계구역 해결조건Computer Engineering/운영체제 2022. 11. 23. 14:50
공유 자원
: 프로세스끼리 공유하는 자원
- 여러 프로세스가 공동으로 이용하는 변수, 메모리, 파일 등
- 공동으로 이용되기 때문에 데이터를 누가, 언제 읽고 쓰느냐에 따라 데이터가 달라짐
임계 구역
: 프로세스에게 동시에 공유되어서는 안되는 공간
- 공유 자원 접근 순서에 따라 실행 결과가 달라지는 프로그램 영역
- 임계 구역 내에서는 프로세스들이 동시에 작업 X
임계 구역 해결조건
상호 배제 Mutual exclusion
- 한 프로세스가 임계 구역에 들어가면 다른 프로세스는 임계 구역 접근 불가
한정 대기 Bounded waiting
- 어떤 프로세스도 무한 대기하지 않아야 함
진행의 융통성 Progress flexibility
- 프로세스 간 진행을 방해해서는 안됨
임계 구역 알고리즘
피터슨 알고리즘
데커 알고리즘
세마포어
- Semaphore (n) : 정수값을 가지는 변수로, 현재 사용 가능한 자원의 수가 저장
- P( ), Try ( Proberen ) : 임계 구역에 들어가기전에 수행되고, 잠금을 수행하는 코드
- V( ), increment ( Verhogen ) : 임계 구역에서 나올 때 수행되며, 잠금 해제와 동기화를 같이 수행하는 코드
더보기참고문헌
조성호 저, 「쉽게 배우는 운영체제」, 한빛아카데미, 2018, 616p
https://ko.wikipedia.org/wiki/%EC%9E%84%EA%B3%84_%EA%B5%AC%EC%97%AD
⊙ 이 글은 개인 공부를 목적으로 작성된 글입니다.
⊙ 내용에 대한 오류나 피드백 감사히 받고 있습니다 !
반응형'Computer Engineering > 운영체제' 카테고리의 다른 글
교착 상태 / 필요 조건, 해결 방법 (0) 2022.11.24 프로세스 간 동기화 및 통신 (0) 2022.11.15 파일과 파일 시스템 (0) 2022.11.15 스레싱과 프레임할당 (0) 2022.11.14 CPU 스케줄링 (0) 2022.11.14