888件ヒット
[1-100件を表示]
(0.104秒)
種類
- 関数 (539)
- 定数 (165)
- インスタンスメソッド (132)
- モジュール関数 (44)
- 特異メソッド (8)
クラス
-
CSV
:: Row (11) - File (11)
- Thread (85)
-
Thread
:: Queue (33)
モジュール
- Etc (33)
- Open3 (33)
-
OpenSSL
:: ASN1 (11) -
Win32
:: Registry :: Constants (132)
キーワード
- << (11)
-
KEY
_ ALL _ ACCESS (11) -
KEY
_ CREATE _ LINK (11) -
KEY
_ CREATE _ SUB _ KEY (11) -
KEY
_ ENUMERATE _ SUB _ KEYS (11) -
KEY
_ EXECUTE (11) -
KEY
_ NOTIFY (11) -
KEY
_ QUERY _ VALUE (11) -
KEY
_ READ (11) -
KEY
_ SET _ VALUE (11) -
KEY
_ WRITE (11) -
SC
_ READER _ WRITER _ LOCKS (11) -
SC
_ THREAD _ PRIORITY _ SCHEDULING (11) -
SC
_ XOPEN _ REALTIME _ THREADS (11) -
STANDARD
_ RIGHTS _ READ (11) -
STANDARD
_ RIGHTS _ WRITE (11) - [] (11)
- decode (11)
- enq (11)
- exit (11)
- flock (11)
- kill (11)
-
pipeline
_ r (22) -
pipeline
_ start (11) - push (11)
-
rb
_ attr (11) -
rb
_ define _ attr (11) -
rb
_ define _ readonly _ variable (11) -
rb
_ mod _ attr _ reader (11) -
rb
_ thread _ abort _ exc (11) -
rb
_ thread _ abort _ exc _ set (11) -
rb
_ thread _ alive _ p (11) -
rb
_ thread _ alloc (11) -
rb
_ thread _ aref (11) -
rb
_ thread _ aset (11) -
rb
_ thread _ check (11) -
rb
_ thread _ create (11) -
rb
_ thread _ critical _ get (11) -
rb
_ thread _ critical _ set (11) -
rb
_ thread _ current (11) -
rb
_ thread _ exit (11) -
rb
_ thread _ initialize (11) -
rb
_ thread _ inspect (11) -
rb
_ thread _ join _ m (11) -
rb
_ thread _ key _ p (11) -
rb
_ thread _ keys (11) -
rb
_ thread _ kill (11) -
rb
_ thread _ list (11) -
rb
_ thread _ local _ aref (11) -
rb
_ thread _ local _ aset (11) -
rb
_ thread _ main (11) -
rb
_ thread _ pass (11) -
rb
_ thread _ priority (11) -
rb
_ thread _ priority _ set (11) -
rb
_ thread _ raise (11) -
rb
_ thread _ raise _ m (11) -
rb
_ thread _ run (11) -
rb
_ thread _ s _ abort _ exc (11) -
rb
_ thread _ s _ abort _ exc _ set (11) -
rb
_ thread _ s _ kill (11) -
rb
_ thread _ s _ new (11) -
rb
_ thread _ safe _ level (11) -
rb
_ thread _ start (11) -
rb
_ thread _ start _ 0 (11) -
rb
_ thread _ status (11) -
rb
_ thread _ stop (11) -
rb
_ thread _ stop _ p (11) -
rb
_ thread _ trap _ eval (11) -
rb
_ thread _ value (11) -
rb
_ thread _ wakeup (11) -
rb
_ thread _ yield (11) -
readonly
_ setter (11) -
report
_ on _ exception (8) - terminate (11)
-
thgroup
_ add (11) -
thread
_ keys _ i (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) -
values
_ at (11)
検索結果
先頭5件
-
Thread
# value -> object (27213.0) -
スレッド self が終了するまで待ち(Thread#join と同じ)、 そのスレッドのブロックが返した値を返します。スレッド実行中に例外が 発生した場合には、その例外を再発生させます。
...スレッド self が終了するまで待ち(Thread#join と同じ)、
そのスレッドのブロックが返した値を返します。スレッド実行中に例外が
発生した場合には、その例外を再発生させます。
スレッドが Thread#kill によって終了した場合......ち結果を出力する例です。
threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.each {|t| p t.value}
最後の行で、待ち合わせを行っ......ていることがわかりにくいと思うなら以下
のように書くこともできます。
threads.each {|t| p t.join.value}... -
static VALUE rb
_ thread _ value(VALUE thread) (18800.0) -
-
Thread
# thread _ variable _ set(key , value) (15317.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
...引数 value をセットしま
す。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく
ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.curre......nt.thread_variable_set(:cat, 'meow')
Thread.current.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]... -
Thread
# thread _ variable _ get(key) -> object | nil (15206.0) -
引数 key で指定した名前のスレッドローカル変数を返します。
...意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、Fiber を切り替えても同じ変数を返す事に注意してください。
例:
Thread.new {
Thread.current.thread_variable_set("foo", "bar") # スレッドローカル
Thread.current["f......yield [
Thread.current.thread_variable_get("foo"), # スレッドローカル
Thread.current["foo"], # Fiber ローカル
]
}.resume
}.join.value # => ['bar', nil]
この例の "bar" は Thread#thread_variable_get により得られ
た値で、nil......はThread#[] により得られた値です。
@see Thread#thread_variable_set, Thread#[]
@see https://magazine.rubyist.net/articles/0041/0041-200Special-note.html... -
VALUE rb
_ thread _ local _ aset(VALUE thread , ID id , VALUE val) (12800.0) -
-
static VALUE rb
_ thread _ initialize(VALUE thread , VALUE args) (12800.0) -
-
static VALUE rb
_ thread _ critical _ set(VALUE obj , VALUE val) (12700.0) -
-
static VALUE rb
_ thread _ s _ kill(VALUE obj , VALUE th) (12700.0) -
-
VALUE rb
_ thread _ local _ aref(VALUE thread , ID id) (12600.0) -
-
static VALUE rb
_ thread _ alive _ p(VALUE thread) (12600.0) -