Ruby 4.0 リファレンスマニュアル

variable $$

$$ -> Integer[permalink][rdoc][edit]

現在実行中の Ruby プロセスのプロセス ID です。 Process?.pid と同じです。

この変数はグローバルスコープです。