2013年10月12日
摘要: 读写信号量,读写互斥,可以多读seg R, W;int read_count=0;void read(){ P(R); if(read_count==0) { P(W); } read_count++; V(R); reading... P(R); read_count--; if(read_count==0) { V(W); } V(R);}void write(){ P(W); writing... V(W);} 阅读全文
posted @ 2013-10-12 21:28 zReachzer 阅读(165) 评论(0) 推荐(0)