解法二
semaphore c[
Integer i=
procedure philosopher_i
begin
if i mod
begin
p(c[i]);
p(c[i+
Eating;
v(c[i]);
v(c[i+
end
else
begin
p(c[i+
p(c[i]);
Eating;
v(c[i+
v(c[i]);
end
end
[
From:http://tw.wingwit.com/Article/program/czxt/201311/24286.html