Operating Systems 2017F Lecture 13
Video
Video from the lecture given on October 19, 2017 is now available.
Code
Files from the lecture are available.
Note
Questions:
Mutex and semaphore?
Mutex is a binary semaphore, it is a semaphore that take a value that is zero or one, a classic semaphore can count.
Mutex stands for ‘mutual exclusion’: I am exclusive access, no one else does.
More general semaphore is used when you need to keep track of numbers.
Most classic semaphore: read write semaphore. which will be seen in the kernel. The idea is multiple reader and only one writer.
Most of the time we use mutex.
dinner philosopher problem
Wiki page: https://en.wikipedia.org/wiki/Dining_philosophers_problem
You have five philosophers sitting around the table, these philosophers will talk, and they will talk so much, they don’t really want to focus on eating. And for some reason there is not enough of forks at the table. There is one fork at every position between the plates. In order to eat anything, you need two forks.(Maybe better to think about using chopsticks instead of forks). There are five people there and only five forks.