From: Joel VanderWerf Date: 2006-07-12T10:49:01+09:00 Subject: Re: Processes and Portability Name Name wrote: > I would like to run a process concurrently (thus if the process goes to > sleep or runs forever, I can still run other code from my main process) > and have all standard out of that process be put into a text file. I > would also like this code to be portable. And finally, I would like to > be able to kill this process at any time (So I will need the pid) I was half expecting the following to work, but it doesn't: t = Thread.new do system "sleep 100000" # or IO.popen or fork... end puts "press return to stop child thread" gets t.kill puts `ps -Af | grep sleep` Process.wait # still waiting for child until ^C Killing a thread that is waiting on system() doesn't stop the child process. Should this be part of the Thread abstraction? Should threads own processes? Maybe not. Just wondering what people think... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407