Ruby 用仮想マシンYARVにおける並列実行スレッドの実装

Bibliographic Information

Other Title
  • Rubyヨウ カソウ マシン YARV ニ オケル ヘイレツ ジッコウ スレッド ノ ジッソウ
  • An Implementation of Parallel Threads for YARV:Yet Another RubyVM

Search this article

Abstract

本論文ではスクリプト言語Ruby 用仮想マシンYARV: Yet Another RubyVM における並列実行スレッド処理機構の実装について述べる.Ruby はその使いやすさから世界中で広く利用されているプログラム言語である.Ruby の特徴の1 つにマルチスレッドプログラミングに対応しているという点があるが,現在広く利用されているRuby 処理系は移植性を高めるため,すべてユーザレベルでスレッド制御を行っている.しかし,このスレッド実現手法では,実行がブロックしてしまう処理がC 言語レベルで記述できない,並列計算機において複数スレッドの並列実行による性能向上ができないなどの問題がある.そこで,現在筆者らが開発中のRuby 処理系YARV において,OS やライブラリなどによって提供されるネイティブスレッドを利用するスレッド処理機構を実装し,複数スレッドの並列実行を実現した.並列化にあたっては,適切な同期の追加が必要であるが,特に並列実行を考慮しないC 言語で記述したRuby 用拡張ライブラリを安全に実行するための仕組みが必要であった.また,同期の回数を減らす工夫についても検討した.本論文では,これらの仕組みと実装についての詳細を述べ,スレッドの並列実行によって得られた性能向上について評価した結果を述べる.

In this paper, we describe an implementation of parallel threads for YARV: Yet Another RubyVM. The Ruby language is used worldwide because of its ease of use. Ruby also supports multi-threaded programming. The current Ruby interpreter controls all threads only in user-level to achieve high portability. However, this user-level implementation can not support blocking task and can not improve performance on parallel computers. To solve these problems, we implement parallel threads using native threads provided by systems software on YARV: Yet Another RubyVM what we are developing as another Ruby interpreter. To achieve parallel execution, correct synchronizations are needed. Especially, C extension libraries for Ruby which are implemented without consideration about parallel execution need a particular scheme for running in parallel. And we also try to reduce a number of times of synchronization. In this paper, we show implementations of these schemes and results of performance improvement on parallel threads execution.

Journal

Citations (2)*help

See more

References(27)*help

See more

Related Projects

See more

Keywords

Details 詳細情報について

Report a problem

Back to top