[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

using backticks ( `cmd`) hang child processes?

Noam Noam

10/29/2007 12:31:00 PM

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.
--
Posted via http://www.ruby-....

3 Answers

Noam Noam

10/29/2007 2:42:00 PM

0

any one? something?
--
Posted via http://www.ruby-....

ara.t.howard

10/29/2007 4:15:00 PM

0


On Oct 29, 2007, at 6:30 AM, Noam Noam wrote:

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

it's all over the archives. probably you are windows and it's a
known issue. your option is to use systemu, for one.

are you on windows?

a @ http://codeforp...
--
it is not enough to be compassionate. you must act.
h.h. the 14th dalai lama




Noam Noam

10/30/2007 4:39:00 PM

0

ara.t.howard wrote:
> On Oct 29, 2007, at 6:30 AM, Noam Noam wrote:
>
>>> are you on windows?
>
> a @ http://codeforp...

i'm using cygwin.
where did you see this issue in the archives?
Thanks

Noam

--
Posted via http://www.ruby-....