るりまサーチ

最速Rubyリファレンスマニュアル検索!
156件ヒット [101-156件を表示] (0.038秒)
トップページ > クエリ:>[x] > クエリ:waitpid[x]

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. integer >
  5. module >

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 >>

Kernel.#fork { ... } -> Integer | nil (112.0)

fork(2) システムコールを使ってプロセスの複製を作 ります。親プロセスでは子プロセスのプロセスIDを、子プロセスでは nil を返します。ブロックを指定して呼び出した場合には、生成し た子プロセスでブロックを評価します。

...ss.pid}, child pid: #{child_pid}"
# => parent process. pid: 81060, child pid: 81329

# 親プロセスでの処理
# ...

# 子プロセスの終了を待って終了。
Process.waitpid(child_pid)
else
puts "child process. pid: #{Process.pid}"
# => child process. pid: 81329

# 子プ...
...=> child process. pid: 79602

# 子プロセスでの処理
sleep(1)
end

puts "parent process. pid: #{Process.pid}, child pid: #{child_pid}"
# => parent process. pid: 79055, child pid: 79602

# 親プロセスでの処理
# ...

# 子プロセスの終了を待って終了。
Process.waitpid(c...

Kernel.#spawn(env, program, *args, options={}) -> Integer (106.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}

親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
もしくは Process.#detach で子プロセスを切り離す...
...ers=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}

「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しいプロセスグループを作りそのリーダーになります。
pid = spawn(command, :pgroup => tru...
...e)
# 整数を渡すとそのグループに所属します。
pid = spawn(command, :pgroup => 10)
//}

「:rlimit_core」「:rlimit_cpu」などで、resource limit を指定します。
詳しくは Process.#setrlimit を見てください。
このオプションには 整数 or 整数2つの配...

Kernel.#spawn(program, *args) -> Integer (106.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...(unsetenv(3))されます。
//emlist[例][ruby]{
# FOO を BAR にして BAZ を削除する
pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
//}

親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
もしくは Process.#detach で子プロセスを切り離す...
...ers=>true)
# FOO だけ
pid = spawn({"FOO"=>"BAR"}, command, :unsetenv_others=>true)
//}

「:pgroup」でプロセスグループを指定できます。
//emlist[][ruby]{
# true, 0 で新しいプロセスグループを作りそのリーダーになります。
pid = spawn(command, :pgroup => tru...
...e)
# 整数を渡すとそのグループに所属します。
pid = spawn(command, :pgroup => 10)
//}

「:rlimit_core」「:rlimit_cpu」などで、resource limit を指定します。
詳しくは Process.#setrlimit を見てください。
このオプションには 整数 or 整数2つの配...

Kernel.#spawn(command, options={}) -> Integer (101.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...子プロセスのプロセスIDを返します。


=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行され...

Kernel.#spawn(env, command, options={}) -> Integer (101.0)

引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。

...子プロセスのプロセスIDを返します。


=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行され...

絞り込み条件を変える

<< < 1 2 >>