thread=5
tmp_fifofile=/temp/$$.fifo
mkfifo $tmp_fifofile
exec 8<>$tmp_fifofile
rm $tmp_fifofile

for i in `seq $thread`
do
    echo >&8
done

while :
do
 read -u 8
    {
     ....代码
   echo >&8
}& 
done
wait
exec 8>&-#释放文件

 

相关文章:

  • 2022-02-05
  • 2022-02-09
  • 2021-12-01
  • 2021-07-07
  • 2021-09-14
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案