250 likes | 335 Views
Department of Computer Engineering, PSU Wannarat Suntiamorntut. 240-323, Part II Process Synchronization. Department of Computer Engineering, PSU Wannarat Suntiamorntut. Thread. Department of Computer Engineering, PSU Wannarat Suntiamorntut. Consumer - Producer : Share Memory.
E N D
Department of Computer Engineering, PSU Wannarat Suntiamorntut 240-323, Part II Process Synchronization
Department of Computer Engineering, PSU Wannarat Suntiamorntut Thread
Department of Computer Engineering, PSU Wannarat Suntiamorntut Consumer - Producer : Share Memory
Department of Computer Engineering, PSU Wannarat Suntiamorntut Problem with Share memory solution
Department of Computer Engineering, PSU Wannarat Suntiamorntut Definition Term
Department of Computer Engineering, PSU Wannarat Suntiamorntut Critical-Section Problem
Department of Computer Engineering, PSU Wannarat Suntiamorntut Critical-Section Problem (Algorithm 1)
Department of Computer Engineering, PSU Wannarat Suntiamorntut Critical-Section Problem (Algorithm 2)
Department of Computer Engineering, PSU Wannarat Suntiamorntut Critical-Section Problem (Algorithm 3)
Department of Computer Engineering, PSU Wannarat Suntiamorntut Critical-Section (Many Processes)
Department of Computer Engineering, PSU Wannarat Suntiamorntut Bakery Algorithm : Explained
Department of Computer Engineering, PSU Wannarat Suntiamorntut Synchronize Hardware
Department of Computer Engineering, PSU Wannarat Suntiamorntut Test and Set for Mutual Exclusion
Department of Computer Engineering, PSU Wannarat Suntiamorntut Semaphores
Department of Computer Engineering, PSU Wannarat Suntiamorntut Using Semaphores
Department of Computer Engineering, PSU Wannarat Suntiamorntut Implement Semaphores
Department of Computer Engineering, PSU Wannarat Suntiamorntut Implementing Semaphores
Department of Computer Engineering, PSU Wannarat Suntiamorntut Dead locks and Starvation P0 P1 wait(S); wait(Q); wait(Q); wait(S); . . . . . . Signal(S); Signal(Q); Signal(Q); Signal(S) ;
Department of Computer Engineering, PSU Wannarat Suntiamorntut Binary Semaphores • a semaphore with an integer value that can range only between 0 and 1. • Can be simpler to implement Signal : wait(S1); C := C +1; if C =< 0 then signal(S2); else wait(S1); Wait : wait(S1); C := C -1; if C < 0 then signal(S1); wait(S2); end signal(S1);
Department of Computer Engineering, PSU Wannarat Suntiamorntut Readers/Writers Problem
Department of Computer Engineering, PSU Wannarat Suntiamorntut Readers have Priority
Department of Computer Engineering, PSU Wannarat Suntiamorntut Comment on Reader Priority
Department of Computer Engineering, PSU Wannarat Suntiamorntut Writer have Priority
Department of Computer Engineering, PSU Wannarat Suntiamorntut Note on Writer have Priority
Department of Computer Engineering, PSU Wannarat Suntiamorntut Dining-Philosophers Problem