操作系统OS2013-01OS2013-05.pptx
文本预览下载声明
Chapter2 Processes and Threads;2.5 Semaphores;2.5 Semaphores;2.5 Semaphores;2.3.5 Semaphores;2.3.5 Semaphores;#define N 100 /* number of slots in the buffer */
typedef int semaphore; /* semaphores are a special kind of int */
semaphore mutex = 1;
semaphore empty = N;
semaphore full = 0; ;2.5 Semaphores;2.5 Semaphores;2.5 Semaphores;2.3.6 Mutexes;2.3.6 Mutexes;2.3.6 Mutexes;2.3.6 Mutexes;2.3.6 Mutexes;2.3.6 Mutexes;2.3.7 Monitor(管程);2.3.7 Monitor(管程);2.3.7 Monitor(管程);2.3.7 Monitor(管程);2.3.7 Monitor(管程);2.3.8 Message Passing;2.3.8 Message Passing;2.3.9 Barriers;Homework(9月14日交);Homework(9月14日交);2.5 Classical IPC Problems;2.5.1 Dining Philosophers Problem;A nonsolution to the dining philosophers problem;Solution to dining philosophers problem;2.5.1 Dining Philosophers Problem;2.5.2 Read and Writer Problem;如果一个新的读者到来,
没有人读写数据库,新读者可以读数据库;
有写者等,但有其它读者正在读,则新读者也可以读;
有写者写,新读者等。
如果一个新的写者到来,
无读者,新写者可以写;
有读者,新写者等待;
有其它写者,新写者等待。;A solution to the readers and writers problem;A solution to the readers and writers problem;Next Class;Thank You !
显示全部