views:

21

answers:

1

I simply want to use ruby, yet I feel that I cannot if my goal includes using multiple threads that do any form of blocking IO. Even for what would be a small script, when I see the need for multiple threads I start to turn to java. Is there a good way I can use Ruby to create multiple threads, have each block when needed? As many of you know, green threads do not support blocking IO as they will cause all threads to block..

+1  A: 

use 1.9 which introduces native threads (and a GLI), or use Jruby, which has fully concurrent native threads. That's what I would do, anyway :)

rogerdpack
Oh, so in 1.9 Thread object is no longer green?
Zombies
yes. http://www.igvita.com/2008/11/13/concurrency-is-a-myth-in-ruby might help.
rogerdpack