るりまサーチ

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

別のキーワード

  1. io/wait wait_writable
  2. io wait_writable
  3. conditionvariable wait
  4. _builtin wait
  5. io/wait wait

検索結果

ThreadsWait#join(*threads) -> () (21107.0)

終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。

...スレッドに指定されたthreadsを加えます。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p thall.threads #=> []
thall.join(*threads)
p thall.threads
#=> [#<Thread:0x216ec dead>, #<Thread:...

ThreadsWait#join_nowait(*threads) -> () (15207.0)

終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。 しかし、実際には終了をまちません。

...ッドに指定されたthreadsを加えます。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p thall.threads #=> []
thall.join_nowait(*threads)
p thall.threads #=> [#<Thread:0x21638 sleep>, #<Thread:...

ThreadsWait#next_wait(nonblock = nil) -> Thread (9113.0)

指定したスレッドのどれかが終了するまで待ちます。

...外 ThreadsWait::ErrNoFinishedThread が発生します。

@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。

@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。

#使用例
require 'thwait'

threads...
...= []
2.times {|i|
threads << Thread.new { sleep i }
}

thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end

@see Queue#pop...

Thread::Queue#num_waiting -> Integer (6106.0)

キューを待っているスレッドの数を返します。

...キューを待っているスレッドの数を返します。

//emlist[例][ruby]{
require 'thread'

q = SizedQueue.new(1)
q.push(1)
t = Thread.new { q.push(2) }
sleep 0.05 until t.stop?
q.num_waiting # => 1

q.pop
t.join
//}...

ThreadsWait#empty? -> bool (3006.0)

同期されるスレッドが存在するならば true をかえします。

...ッドが存在するならば true をかえします。

使用例
require 'thwait'

threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p thall.threads.empty? #=> true
thall.join(*threads)
p thall.threads.empty? #=> false...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (48.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...argument will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352 17419
* ConditionVariable
* ConditionVariable#wait may now invoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by def...
...values. 15822
* IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel...
...d and how to implement the scheduler hooks. 16786
* Fiber.blocking? tells whether the current execution context is blocking. 16786
* Thread#join invokes the scheduler hooks `block`/`unblock` in a non-blocking execution context. 16786
* Thread
* Thread.ignore_deadlock accessor has been...

NEWS for Ruby 2.0.0 (36.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ld backtrace location
information. These are returned by Thread#backtrace_locations and
Kernel#caller_locations
* 非互換: Thread#join, Thread#value は対象のスレッドがメインスレッドか現在のスレッドである場合、
ThreadError を発生させます...
...cond argument is true.

* Object#respond_to_missing?, Object#initialize_clone, Object#initialize_dup
* private になりました

* Thread#join, Thread#value
* 上を参照

* Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize, Mutex#sleep
* 上を参照

=== 標準添付...
...ed.
* 拡張: IO#raw, IO#raw!, IO#getch キーワード引数 :min, :time を受け付けます。

* io/wait
* 追加: IO#wait_writable
* 追加: IO#wait_readable は IO#wait の別名です。

* json
* 1.7.7 に更新

* net/http
* 新機能
* Proxies are now autom...

Thread::ConditionVariable (36.0)

スレッドの同期機構の一つである状態変数を実現するクラスです。

...状況を解決するのが Condition Variable です。

スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止めます。他のスレッド b において条件が満たされたなら signal
メソッドでスレッド a...
...onditionVariable.new

a = Thread.start {
mutex.synchronize {
...
while (条件が満たされない)
cv.wait(mutex)
end
...
}
}

b = Thread.start {
mutex.synchronize {
# 上の条件を満たすため...
...l.push th

th = Thread.new {
while obj = q.recv
print "recv ", obj, "\n"
end
}
l.push th

l.each do |t|
t.join
end
end

実行すると以下のように出力します。

$ ruby condvar.rb
sent Apple
recv Apple
sent Banana
recv Banana
sen...

ruby 1.8.4 feature (36.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...le::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_missing [bug]>))
* ((<ruby 1.8.4 feature/IO [bug]>...
...: File.join [bug]

#Wed Oct 19 08:28:32 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * file.c (rb_file_join): elements may contain null pointer strings.
# report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326]

NULLポインタを持つStringを渡すとFile.joinがSEGV...
...修正。((<ruby-core:06326>))

: Thread#pass [bug]

#Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (load_wait): need not to call rb_thread_schedule()
# explicitly. [ruby-core:04039]
#
# * eval.c (rb_thread_schedule): clear rb_thread_critical.
#...

1.6.8から1.8.0への変更点(まとめ) (24.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...追加

: ((<Process/Process.abort>)) [new]
: ((<Process/Process.exit>)) [new]

追加。関数 abort, exit と同じ。

: ((<Process/Process.waitall>)) [new]
追加

: ((<Process::Status#pid|Process::Status/pid>)) [new]

追加

=== Range

: ((<Range#step|Range/step>)) [new]...
...) [compat]
ローカル側アドレスを省略可能な第3,4引数で指定できるようになりました。

=== Thread

: ((<Thread#join|Thread/join>)) [compat]

スレッドを待ち合わせる時間を limit で指定できるようになりました。

: ((<Thread/Thread.list>)) [c...
...ナリモードになりました(((<ruby-dev:19583>)))

: ((<File/File.dirname>)) [CHANGE]
: ((<File/File.expand_path>)) [CHANGE]
: ((<File/File.join>)) [CHANGE]

DOSISHなプラットフォームでのドライブレター対応が強化されました。
((<DOSISH 対応>))を参照。

: ((<...

絞り込み条件を変える