Implementing dining philosopher and binary semaphore