@article{oai:ipsj.ixsq.nii.ac.jp:00145138, author = {夏, 澄彦 and 佐藤, 芳樹 and 千葉, 滋 and Sumihiko, Natsu and Yoshiki, Sato and Shigeru, Chiba}, issue = {3}, journal = {情報処理学会論文誌プログラミング(PRO)}, month = {Sep}, note = {計算に依存関係のあるプログラムの並列化には,バリア同期を利用した協調処理の記述が有用である.従来のバリア同期は過剰な同期スレッドを誘発するため,JavaではCountDownLatchやPhaserのようにバリア待機処理とバリア到達処理をソースコード中の任意の位置に分けて記述できるPoint-to-Point型の同期ライブラリが用いられている.しかし,エージェントシミュレーションのような抽象度の高いソフトウェアでは,バリア到達処理コードの散在によるモジュラリティの低下も問題となってくる.また,大規模なシミュレーションを行う場合,同期時の待機スレッド数増加によるCPU実行効率低下や占有メモリの増加を防ぐため,ユーザが明示的にスレッドコードを分割する必要があり,並列化のための記述量が増加する.そこで,本論文では,ロードタイムにバイトコード変換を行うことで,散在するバリア到達処理をオブジェクトの状態に基づく直感的な条件式として記述可能なバリア同期を提案する.与えられた条件式に基づき,条件が満たされる可能性のある箇所すべてにバリア条件のチェックコードと,到達処理コードが自動挿入される.さらに,バリア同期処理の前後でスレッドが実行するコードを自動的に分割することで,モジュラリティを維持したまま,待機スレッドを削減できるようにした.本研究で開発したバリア同期機構は,大規模な歩行者シミュレーションアプリケーションへ適用して実行性能を評価した., Cooperative computing with barrier synchronization is a typical approach to the parallization of a program involving dependency among its computations. Since traditional synchronization primitives often cause excessive parallelism, Java provides CyclicBarrier and Phaser, which implements point-to-point synchronization; they separate arrival at a barrier and release from a barrier. However, these primitives degrade code modularity since synchronization code is spread over the program if it deals with higher-level abstraction, for example, it is for agent simulation. Furthermore, if a program is for large-scale simulation, these primitives do not help shorten the life time of each thread so that the number of waiting threads will not be too many to cause excessive parallelism or too large memory footprint. Programmers have to manually do that and hence the code modularity is further degraded. This paper proposes a new primitive for barrier synchronization. Programmers can describe barrier synchronization with this primitive in a modular fashion. The computations at arrival at a barrier is spread over the program but they are described at one place with a condition expression on the state of objects. The proposed primitive performs bytecode translation at load time so that the code necessary at arrival at a barrier is automatically inserted according to that condition expression. Moreover, the proposed primitive splits a thread into two at barrier synchronization; the number of waiting threads is thereby decreased without sacrificing modularity. This paper also presents the result of the application of the proposed primitive to large-scale pedestrian simulation.}, pages = {11--21}, title = {軽量で抽象度の高い条件付きバリア同期とその実装方法}, volume = {8}, year = {2015} }