スレッド局所性を利用したJavaロックの高速化

書誌事項

タイトル別名
  • スレッド キョクショセイ オ リヨウ シタ Java ロック ノ コウソクカ
  • Accelerating Java Locks by Utilizing Their Thread Locality

この論文をさがす

抄録

Javaでは言語の性質上,オブジェクトに対するロック操作が頻繁に行われる.これを高速化することは,システム全体の性能向上に非常に重要である.オブジェクトがそれぞれどのスレッドにロックされているかに着目した調査を行ったところ,特定のスレッドにのみ頻繁にロックされているという「スレッド局所性」が見られることが分かった.この性質に着目し本論文では,各オブジェクトごとに特定のスレッドに「ロック予約」を与え,ロック処理を高速化する手法について述べる.予約を持っているスレッドは,従来よりも軽い処理でそのオブジェクトのロックを行える.具体的には,従来ロック処理に不可欠と考えられていたcompare_and_swapなどの不可分命令ではなく,単純なメモリアクセス命令でロックを獲得/解放できる.予約者以外のスレッドがロックを行った時点でロック予約が解除され,以後そのオブジェクトは従来の方式でロックが行われる.この予約ロック機構を,IBM Java VMとJITコンパイラに実装し,いくつかのベンチマークを走らせたところ,従来のロック手法に比べて最大で53%の性能向上が確認された.

In Java execution, lock operations are performed very frequently to realize exclusive oper-ations among multiple threads. Therefore, accelerating the lock performance has been very important to execute Java-based applications faster. We investigated the lock behavior of Java programs, focusing on the relation of each object and threads acquiring the object’s lock. It turned out that for many objects, the lock is acquired by only one thread specific to the object, even in multi-threaded Java programs. By utilizing the thread locality, this paper shows a novel ultra-fast locking technique for Java. The algorithm allows locks to be reserved for threads. When a thread attempts to acquire a lock, it can do without any atomic operation if the lock is reserved for the thread. Otherwise, it cancels the reservation and falls back to a conventional locking algorithm. We have implemented the lock reservation mechanism in IBM’s production virtual machine and JIT compiler. The results show that it achieved performance improvements up to 53%.

収録刊行物

被引用文献 (1)*注記

もっと見る

参考文献 (30)*注記

もっと見る

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

問題の指摘

ページトップへ