OA Protocol for Mutual Exclusion T. Dekker 1966 基于3个共享变量c1,C2和turn的互斥协议,初始状态三个变量均为0 Process 1 Process 2 C1=1 C2=1 turn =1. turn =2 L: if c2=1& turn=1 L: if cl=1& turn=2 then go to L then go to L critical section> critical section> c1=0; c2=0; turn=i保证仅仅进程i等 变量c1和c2保证n个进程互斥地访问临界区,该算法由 Dijkstra给出,担当精巧 2021/2/11 计算机体系结构A Protocol for Mutual Exclusion T. Dekker, 1966 24 Process 1 ... c1=1; turn = 1; L: if c2=1 & turn=1 then go to L < critical section> c1=0; 基于3个共享变量c1, c2 和turn的互斥协议,初始状态三个变量均为0. • turn = i 保证仅仅进程 i 等待 • 变量 c1 和 c2 保证n个进程互斥地访问临界区,该算法由 Dijkstra给出,相当精巧 Process 2 ... c2=1; turn = 2; L: if c1=1 & turn=2 then go to L < critical section> c2=0; 2021/2/11 计算机体系结构