Blocking IO in Windows threads

R

Robert Sheehan

Under Linux the following code from Dave Thomas doesn't block.

Thread.new do
loop do
puts "You said #{gets}"
end
end

10.times do
sleep(1)
puts "Say something"
end

But under Windows with the latest one-click installer, it does.
Any ideas on how I can do something similar on Windows? It also doesn't
seem to have "io/wait".

Thanks
 

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

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top