るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. kernel p
  5. matrix p

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

ThreadsWait#threads -> Array (21137.0)

同期されるスレッドの一覧を配列で返します。

...ドの一覧を配列で返します。

使用例
require 'thwait'

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

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

ThreadsWait#empty? -> bool (9148.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...

Etc::SC_THREAD_PRIO_PROTECT -> Integer (6203.0)

Etc.#sysconf の引数に指定します。

Etc.#sysconf の引数に指定します。

詳細は sysconf(3) を参照してください。

Etc::SC_THREAD_ROBUST_PRIO_PROTECT -> Integer (6203.0)

Etc.#sysconf の引数に指定します。

Etc.#sysconf の引数に指定します。

詳細は sysconf(3) を参照してください。

Etc::SC_XOPEN_REALTIME_THREADS -> Integer (6203.0)

Etc.#sysconf の引数に指定します。

Etc.#sysconf の引数に指定します。

詳細は sysconf(3) を参照してください。

絞り込み条件を変える

Etc::CS_POSIX_V7_THREADS_CFLAGS -> Integer (6202.0)

Etc.#confstr の引数に指定します。

Etc.#confstr の引数に指定します。

詳細は confstr(3) を参照してください。

Etc::CS_POSIX_V7_THREADS_LDFLAGS -> Integer (6202.0)

Etc.#confstr の引数に指定します。

Etc.#confstr の引数に指定します。

詳細は confstr(3) を参照してください。

ThreadGroup (6006.0)

スレッドグループを表すクラスです。グループに属する Thread をまとめて 操作することができます。

...readGroup::Default に属します。

: 例:

生成したすべてのThreadが終了するのを待つ

5.times {
Thread.new { sleep 1; puts "#{Thread.current} finished" }
}

(ThreadGroup::Default.list - [Thread.current]).each {|th| th.join}

p
uts "all threads finish...
...(Thread.exclusive参照)

Thread.exclusive do
(ThreadGroup::Default.list - [Thread.current]).each {|th| th.join}
end

=== ThreadGroup#freeze と ThreadGroup#enclose の違い

どちらのメソッドでも ThreadGroup#add によるスレッドの追加ができなくなる点は同...
...する ThreadGroup が freeze
されている場合、Thread.new{ ... } はエラーになります。ThreadGroup が enclose されているだけでは、
Thread.new{ ... } はエラーになりません。生成されたスレッドは従来通り 親スレッドの ThreadGroup に属します...

ThreadsWait.new(*threads) -> ThreadsWait (3231.0)

指定されたスレッドの終了をまつための、スレッド同期オブジェクトをつくります。

...param threads 終了を待つスレッドを一つもしくは複数指定します。

使用例
require 'thwait'

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

thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
p
rintf("end %s\n", th.insp...

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

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

...threads で指定されたスレッドを指定します。

@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。

require 'thwait'

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

thall = ThreadsWai...
...t.new
p
thall.threads #=> []
thall.join(*threads)
p
thall.threads
#=> [#<Thread:0x216ec dead>, #<Thread:0x21660 dead>, #<Thread:0x215d4 dead>, #<Thread:0x214bc dead>]...

絞り込み条件を変える

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

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

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

@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。

require 'thwait'

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

thall = ThreadsWait.new
p
thall.threads #=> []
thall.join_nowait(*threads)
p
thall.threads #=> [#<Thread:0x21638 sleep>, #<Thread:0x215ac sleep>, #<Thread:0x21520 sleep>, #<Thread:0x21494 sleep>, #<Thread:0x21408 sleep>]
# 実際には終了を待...
...っていない。sleep している。...
<< 1 2 3 ... > >>