Ruby 3に向けた新しい並行実行モデルの提案

書誌事項

タイトル別名
  • A Proposal for a New Concurrent Execution Model in Ruby 3

この論文をさがす

抄録

マルチスレッドプログラミングは,共有するデータに対して,複数のスレッドから同時に読み込み,書き込みを行うとデータレースなどの問題を発生させるため,排他制御などの同期を適切に行わねばならず,難しい.この問題は,スレッドが変更可能なデータを簡単に共有できるため生じるので,そのような共有を制限する方法が必要である.プログラミング言語Rubyの次期メジャーバージョンであるRuby 3では,マルチスレッドプログラミングの持つ難しさを緩和するため,“Guild” というRuby向けの新しい並行実行モデルを検討している.インタプリタは1つ以上のGuildを持つ.変更可能なすべてのオブジェクトはある1つのGuildに所属し,Guild間では,変更可能なオブジェクトを共有しない.ただし,不変オブジェクトや,クラスやモジュールは共有する.Guildは1つ以上のスレッドを持ち,異なるGuildは並列に実行する.Guild間の通信はチャネルを通して行い,変更可能なオブジェクトをGuild間で通信するにはコピーと移籍という2つの方式を提供する.移籍は,所属するGuildを変更する操作であり,単なるコピーより軽量となる.性能などの観点から,変更可能なオブジェクトを共有しなければならない場合,特別なデータ構造を提供することができる.本提案は,既存のアイデアの「いいとこどり」を狙ったものである.本発表では,この並行実行モデルの目論見について議論する.

Multi-thread programming is difficult because data which shared by multiple threads requires appropriate synchronization by mutual exclusion or other techniques to avoid issues such as data race and so on. This problem is because sharing mutable data between threads easily, so that we need a way to restrict such sharing. Ruby 3 is the next major release of programming language Ruby. Ruby 3 aims to introduce new concurrent execution model for Ruby named “Guild” to avoid multi-thread programming difficulties. An interpreter has at least one Guild. All of mutable objects belong to one guild and multiple guilds can not share mutable objects. But guilds can share immutalbe objects and class/module objects. Guild has at least one thread and threads belong to different guild can run in parallel (simultaneously). Inter guild communication is given by channel. There are two way to communicate mutable objects each other, one is copy and another is transfer membership (shortly, move). Transfering membership means changing belonging guild to another guild. It is faster than simple copying. If we need to share mutable objects because of performance, we can offer special data structure. Our proposal is to cherry picking existing good ideas. In this presentation, we will discuss about our concurrent execution model design.

収録刊行物

キーワード

詳細情報 詳細情報について

  • CRID
    1050845762838523648
  • NII論文ID
    170000148644
  • NII書誌ID
    AA11464814
  • ISSN
    18827802
  • Web Site
    http://id.nii.ac.jp/1001/00182199/
  • 本文言語コード
    ja
  • 資料種別
    article
  • データソース種別
    • IRDB
    • CiNii Articles

問題の指摘

ページトップへ