入れ子関数を利用したマルチスレッドの実現

書誌事項

タイトル別名
  • Implementation of Multiple Threads by Using Nested Functions
  • イレコ カンスウ オ リヨウ シタ マルチスレッド ノ ジツゲン

この論文をさがす

説明

プログラム中に記述されたスレッドをすべてOS が提供するスレッドに対応させると大きなオーバヘッドが発生するため,ユーザレベルのマルチスレッドを使用することが有効である.本論文ではユーザレベルのスレッド,より正確には,言語処理系により実現される言語レベルのマルチスレッドの実現の方法として入れ子関数を用いる方法を提案する.入れ子関数は,定義されたときの環境でlexicalスコープの変数にアクセスすることができ,そのポインタは一種のクロージャとして利用することができる.各関数に自分と同等の計算を続けるための入れ子関数を持たせ,その入れ子関数のポインタを保存してスレッドの未処理の計算(継続)を先行して実行したい場合に呼び出せるようにすることによってマルチスレッドを実現する.また,これをGCC (GNU C Compiler )の入れ子関数をそのまま用いて実現するとオーバヘッドが無視できないので,それを改善する方法についても述べる.

Using OS-level threads for all threads described in a program incurs a large overhead. Thus it is better to use user-level threads. In this paper, we propose a method to implement user-level multiple threads, more precisely, high-level language threads realized by a language system by using nested functions. A nested function can access the lexically scoped variables in the definition-time environment and its pointer can be used as a kind of closure. To implement multiple threads, every function has its own nested function to continue its equivalent computation and save the pointer of the nested function to be called later to early execute the thread’s unprocessed computation (continuation). Since the naive implementation using GNU C Compiler’s nested functions incurs a considerable overhead, we also discuss an improvement to enhance performance.

収録刊行物

被引用文献 (4)*注記

もっと見る

参考文献 (8)*注記

もっと見る

関連プロジェクト

もっと見る

キーワード

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

問題の指摘

ページトップへ