[問題] proecess間的mutual exclusive RW
請教一下
一篇文章
讓十個process去read
一個process一次讀一列出來
怎麼在shell script下保證這十個process不會讀到同樣的列
EX:每支process的內容
while(`cat file | wc -l`)
head -n1 file; sed -i '1d' file
end
如果在head -n1 file時發生context switch
有沒有可能在sed還沒把第一行刪掉時另一個process也拿到同一行?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.210.165.114
推
03/17 21:23, , 1F
03/17 21:23, 1F
→
03/17 21:37, , 2F
03/17 21:37, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):