using backticks ( `cmd`) hang child processes?

N

Noam Noam

Hi All,

i execute small ruby code:

puts("in x\n")
x = Thread.current
y = Thread.start {
i = 0;
while (1)
puts("in y #{i}\n")
STDOUT.flush()
i +=1;
end
puts("in y1\n")
STDOUT.flush()

}
puts("in x1\n")
STDOUT.flush()
# system("sleep 5")
`sleep 5`

it seems that using `sleep 5` cause y thread to hang.
if i change in and remark `sleep 5` and unmark system command , it seems
to work just fine.

is it a bug?
is this is the righr behavior?
i'm using a little bit old version of ruby (1.8.2) but still, i didn't
find any post about this issue.

i'll happy to hear any comment about this issue.

Thanks,
Noam.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top