Subject: [ruby-list:20462] Re: thread in loop
From: Tomoyuki Kosimizu <greentea@ 2 o e n j
Date: Thu, 3 Feb 2000 07:31:25 +0900
References: 204552045620461
In-reply-to: 20461
越水です。
例の問題は、Producer/Consumer問題といえますから、Queueを使う方法もあり
ますか。
require 'thread'
q = Queue.new
for i in 1..10
q.push i
Thread.new {
th_i = q.pop
p th_i
}
end
越水
greentea / fa2.so-net.ne.jp