반응형
1. Using 'full' and 'empty' variables
to make producer wait when buffer is full, and to make consumer wait when buffer is empty
2. Fix deadlocked code
: It should be same order between producer's sem_init and consumer's sem_init
Because if the sem_init order is not the same, it will be in the following state
mutex1 = 0, mutex2 = 0
So, nobody can pass sem_init.
반응형
'Computer Science > Operating System' 카테고리의 다른 글
Theory 9) File System Implementation (0) | 2020.12.17 |
---|---|
Theory 8) File System Interface (0) | 2020.12.17 |
Practice 5) Thread & Semaphore 1 (0) | 2020.12.17 |
이론 7) 가상 메모리 (0) | 2020.12.03 |
이론 6) 주 메모리 관리 기법 3 (0) | 2020.12.02 |