るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.052秒)
トップページ > クエリ:nil[x] > クエリ:end[x] > クエリ:ConditionVariable[x]

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. object nil
  5. _builtin nil

種類

ライブラリ

キーワード

検索結果

Thread::ConditionVariable (18090.0)

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

...一つである状態変数を実現するクラスです。

以下も ConditionVariable を理解するのに参考になります。

https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF

=== Condition Variable とは

あるスレッド A が排他領域で動いていたとしま...
...典型的な
使用例です。

mutex = Mutex.new
cv = ConditionVariable.new

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

...
}
}

b = Thread.start {...
...}
end


alias send enq
alias recv deq
end


if __FILE__ == $0
q = TinyQueue.new(1)
foods = 'Apple Banana Strawberry Udon Rice Milk'.split
l = []

th = Thread.new {
for obj in foods
q.send(obj)
print "sent ", obj, "\n"
end

q.send nil...

NEWS for Ruby 2.5.0 (78.0)

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

...547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加...
...7688
* 数値の比較メソッド(<,<=,>=,>)は、coerceメソッドで発生した例外を隠蔽しなくなりました。
coerceがnilを返す場合、変換は不可能です。7688

* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しまし...
...しました。
シードを必要としない用途で有用です。9569

* Socket
* Socket::Ifaddr#vhid を追加 13803

* ConditionVariable, Queue, SizedQueue を速度向上のため再実装しました。
これらのクラスはStructのサブクラスではなくなりま...

NEWS for Ruby 3.0.0 (78.0)

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

...> a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end

//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]...
...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...