タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

exception-handlingとrubyとthreadに関するnabinnoのブックマーク (2)

  • Class: Thread (Ruby 2.1.4)

    Threads are the Ruby implementation for a concurrent programming model. Programs that require multiple threads of execution are a perfect candidate for Ruby's Thread class. For example, we can create a new thread separate from the main thread's execution using ::new. thr = Thread.new { puts "Whats the big deal" } Then we are able to pause the execution of the main thread and allow our new thread t

  • スレッド (Ruby 3.4 リファレンスマニュアル)

    [edit] スレッドとはメモリ空間を共有して同時に実行される制御の流れです。 Ruby ではスレッドはThread クラスのインスタンスとして表されます。 実装 ネイティブスレッドを用いて実装されていますが、現在の実装では Ruby VM は Giant VM lock (GVL) を有しており、同時に実行されるネイティブスレッドは常にひとつです。ただし、IO 関連のブロックする可能性があるシステムコールを行う場合には GVL を解放します。その場合にはスレッドは同時に実行され得ます。また拡張ライブラリから GVL を操作できるので、複数のスレッドを同時に実行するような拡張ライブラリは作成可能です。 スケジューリング Ruby のスレッドスケジューリングはネイティブスレッドのそれを利用しています。よって詳細はプラットフォームに依存します。 メインスレッド プログラムの開始と同時に生成され

  • 1