I have a ffmpeg-like program that is launched by erlang server and it is very busy doing its job.<div><br></div><div>Sometimes erlang server can decide to kill it.</div><div><br></div><div>I have implemented it so: there is a second thread that is reading stdin. If stdin is closed, this thread immediately calls _exit()</div><div><br></div><div>Such approach works good but it requires modification of program.</div><div> </div>