排他制御機構を選択できるクリティカルセクションの設計と実装

書誌事項

タイトル別名
  • Design and Implementation of Critical Sections with a Selectable Mutual Exclusion Mechanism

この論文をさがす

説明

近年,マルチコア CPU の普及によって,並行プログラミングが重要になってきている.並行処理の記述では,共有メモリの排他制御が必要となるが,現状の mutex lock による排他制御手法には,記述を難しくする 2 つの問題点がある.第 1 に,アプリケーションロジック中に排他制御の記述が混在してしまう点,第 2 に,並行性を維持するために,制御区間を細かく指定する必要がある点である.後者の問題点の解決法として,Software Transactional Memory(STM) という排他制御機構が提案されているが,競合が頻繁に起こる場合の性能低下が大きく,mutex lock と STM を状況によって使い分けるのが好ましい.そこで本発表では,ロジックとクリティカルセクション,排他制御機構の 3 つを分離するシステムを提案する.提案機構は,排他制御機構に依存しないクリティカルセクションをアノテーションによって記述できるようにする.その記述に基づき,指定した排他制御機構用コードをアスペクトとして生成し,ロジックに織り込むことで排他制御を実現する.これによってユーザは,提案方式の記述を行うだけで,アプリケーションごとに適した排他制御機構を使い分けられるようになる.本発表では,提案機構の設計と実装について述べ,いくつかの実験により,排他制御機構を選択できることの有効性を示す.

Recently, concurrent programming is becoming more and more important because multi-core processors are quite common. Although mutual exclusion for shared memory is necessary in concurrent programs, there are two difficulties of using the mutex lock mechanism. First, the description of mutual exclusion is mixed in that of the application logic. Second, the programmer has to specify each critical section with fine-granularity to achieve high degree of concurrency. Software transactional memory (STM) resolves the second problem. However, since applications using STM have poor performance when many conflicts happen frequently, it is necessary to use a suitable mutual exclusion mechanism depending on the target program. In this presentation, we propose a system that enables the programmer to write a program with clearly-separated descriptions of three factors ―logic, critical sections and a mutual exclusion mechanism. The proposed system provides an annotated critical section and then generates aspect codes for the specified mutual exclusion mechanism. Mutual exclusion is achieved by weaving the aspect into the logic code. As a result, the proposed system enables the programmer to select a suitable mutual exclusion mechanism in each application. In this presentation, we also show an implementation of the proposed system, and its effectiveness through some experiments.

収録刊行物

キーワード

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

問題の指摘

ページトップへ