管道 本地编辑 | 打开本地目录 | 复制路径 管道解决读写问题 - 读者是否读: 有没有正在写的?有没有外面在等的写者? -- (AW+WW)>0 - 读者结束是否唤醒: 是不是最后一个?有没有外面在等待写者? -- AR==0 && WW>0 - 写者是否写: 有没有正在写的?有没有正在读的? -- (AW+AR)>0 - 写者结束是否唤醒: 外面有没有想写的,有没有想读的? -- 有一种层次关系 -- if(WW>0)else if(WR>0) Was this page helpful? Thanks! You can leave some advices in the comment section below. Comments