From: Jim Freeze Date: 2002-07-24T23:08:09+09:00 Subject: Re: Can I get data back from a fork? On Wed, Jul 24, 2002 at 10:59:15PM +0900, ts wrote: > >>>>> "J" == Jim Freeze writes: > > >> job.pid = Process.fork { redirect(job) } > > job is created in a process > > >> def redirect(job) > >> job.result = system(job.cmd) #=> job.result has a value here > > you modify `job' in *another* process > > >> job.result #=> job.result is empty. Why? > > you retrieve the value that was assigned in the initial process > > `job' is not a shared variable That is what I figured, but I when I printed out the job.id for both processes, they were the same. Was that just a coincidence? Jim -- Jim Freeze If only I had something clever to say for my comment... ~