No. | : 907 |
Title | : Re: V1.1.1.6k64 Thank you and have a happy new year! |
Date | : 2018/12/26(Wed) 14:43:41 |
Name | : Akio Morita |
URL | : |
> Changes:
> 1. Use S. Yamada's patch on utils.c to avoid piling up of temp files. He saids that using a pipe instead of a file was better to receive results of shell commands, but it has not been included so far, due to a bad experience of mine on pipe in an old system, probably HP-UX.
>
この"bad experience"というのは、backgroundな sub-processでは無く、foreground sub-processの出力先にpipeを使ったケースではないでしょうか?
pipeへのwrite(2)は、kernelのI/O bufferが埋まるとreader側が読みにくるまでblocking waitに入るので、foreground sub-processの出力をpipeへ向けた場合、write(2)のblockingによりsub-processが終了しないために、pipeのreaderである main-processも進行せずにデッドロックします
MAIN trunk系の実装は、sub-processがforeground時はunlink済みのファイル記述子、sub-processがbackground時はpipe(2)が生成するファイル記述子を使って実装しています(参考までに)
- WebForum -