るりまサーチ

最速Rubyリファレンスマニュアル検索!
18件ヒット [1-18件を表示] (0.123秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

SizedQueue (52019.0)

Alias of Thread::SizedQueue

...Alias of Thread::SizedQueue...

Thread::SizedQueue (32015.0)

サイズの最大値を指定できる Thread::Queue です。

...1 の SizedQueue オブジェクトに
することによって、入力される行と出力される行が同じ順序になります。
q = [] にすると入力と違った順序で行が出力されます。

require 'thread'

q = SizedQueue.new(1)

th = Thread.start {
while line = q...
....pop
print line
end
}

while l = gets
q.push(l)
end
q.push(l)

th.join...