著者
河内谷清久仁 古関 聰 小野寺 民也
出版者
一般社団法人情報処理学会
雑誌
情報処理学会論文誌プログラミング(PRO) (ISSN:18827802)
巻号頁・発行日
vol.44, no.15, pp.13-23, 2003-11-15
被引用文献数
1

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%.

言及状況

Twitter (2 users, 2 posts, 0 favorites)

@nminoru_jp SPECjbb200xのようなロックのスレッド局所性が高い場合に、atomic命令を使わない1手法です http://t.co/12Jp2Zo1

収集済み URL リスト