
操作系统
站在巨人的肩膀之上
软硬件兼通,嵌入式工程师,架构师
展开
-
PV操作 飞机票、理发师、银行、缓冲区、吸烟
一、飞机票问题Var A : ARRAY[1..m] of integer; mutex : semaphore; mutex:= 1;cobeginprocess Pi var Xi:integer;begin<span style="white-space:pre"> </span>L1: 按旅客定票要求找到A[j]; P(mutex...原创 2019-05-26 10:27:10 · 1527 阅读 · 0 评论 -
PV操作经典问题
一、5位哲学家就餐问题semaphore fork[5];for (int i=0;i<5;i++)fork[i]=1;cobeginprocess philosopher_i( ) { //i= 0,1,2,3,4 while(true) { think( ); P(fork[i]); //先取右手的叉子 P(fork[(i+1...原创 2019-05-26 10:33:04 · 2174 阅读 · 1 评论