44件ヒット
[1-44件を表示]
(0.040秒)
種類
- インスタンスメソッド (22)
- 文書 (11)
- クラス (11)
クラス
キーワード
-
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) - wait (22)
検索結果
先頭5件
-
Thread
:: ConditionVariable (18030.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...一つである状態変数を実現するクラスです。
以下も ConditionVariable を理解するのに参考になります。
https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF
=== Condition Variable とは
あるスレッド A が排他領域で動いていたとしま......リソースの空きを
待っていても、いつまでも空くことはありません。
以上のような状況を解決するのが Condition Variable です。
スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを......ice Milk'.split
l = []
th = Thread.new {
for obj in foods
q.send(obj)
print "sent ", obj, "\n"
end
q.send nil
}
l.push th
th = Thread.new {
while obj = q.recv
print "recv ", obj, "\n"
end
}
l.push th
l.each do... -
Thread
:: ConditionVariable # wait(mutex , timeout = nil) -> self (3145.0) -
mutex のロックを解放し、カレントスレッドを停止します。 Thread::ConditionVariable#signalまたは、 Thread::ConditionVariable#broadcastで送られたシグナルを 受け取ると、mutexのロックを取得し、実行状態となります。
...mutex のロックを解放し、カレントスレッドを停止します。
Thread::ConditionVariable#signalまたは、
Thread::ConditionVariable#broadcastで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。
@param mutex Thread::Mutex......ます。この場合はシグナルを受け取
らなかった場合でも指定した秒数が経過するとスリープを終了
します。省略するとスリープし続けます。
@see Thread::ConditionVariable#signal, Thread::ConditionVariable#broadcast......mutex のロックを解放し、カレントスレッドを停止します。
Thread::ConditionVariable#signalまたは、
Thread::ConditionVariable#broadcastで送られたシグナルを
受け取ると、mutexのロックを取得し、実行状態となります。
@param mutex Mutex オブ... -
MonitorMixin
:: ConditionVariable # wait(timeout = nil) -> bool (3125.0) -
モニタのロックを開放し、現在のスレッドを停止します。
...す。
これを呼ぶスレッドはモニタのロックを保持している必要があります。
MonitorMixin::ConditionVariable#signal や
MonitorMixin::ConditionVariable#broadcast
で起こされるまでスレッドは停止し続けます。
timeout を与えた場合は最大 timeout......での秒数。指定しなかった場合はタイムアウトしません。
@raise ThreadError ロックを持っていないスレッドがこのメソッドを呼びだした場合に発生します
@see MonitorMixin::ConditionVariable#wait_while, MonitorMixin::ConditionVariable#wait_until... -
NEWS for Ruby 2
. 5 . 0 (42.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...7688
* 数値の比較メソッド(<,<=,>=,>)は、coerceメソッドで発生した例外を隠蔽しなくなりました。
coerceがnilを返す場合、変換は不可能です。7688
* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しまし......l".freeze と同じです) 13295
* String#casecmp, String#casecmp? に文字列でない引数を与えた場合、TypeErrorを発生させずにnilを返すようにしました
13312
* String#start_with? は正規表現を受け取れるようになりました 13712
* String#del......しました。
シードを必要としない用途で有用です。9569
* Socket
* Socket::Ifaddr#vhid を追加 13803
* ConditionVariable, Queue, SizedQueue を速度向上のため再実装しました。
これらのクラスはStructのサブクラスではなくなりま... -
NEWS for Ruby 3
. 0 . 0 (30.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...val when called with one 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......da's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when......* `Struct`: reader methods for 10th or later members
* Constant references are inlined.
* Always generate appropriate code for `==`, `nil?`, and `!` calls depending on a receiver class.
* Reduce the number of PC accesses on branches and method returns.
* Optimize C method call...