去年のJJUGナイトセミナー JVM特集で実施した「HotSpot のロック: A Peek Under the Hood」の続きのセッションです。
java.util.concurrentやJava Memory Modelの実装について、いくつかご紹介します。これらで不可欠な技術がJVMとクラス・ライブラリでどのように提供されているかを簡単に説明します。たとえば、volatileキーワードの利用時に、JITコンパイルによって生成されるコードはどのように変わるかを分析します。
6. Web サーバ
picture: Coolcaesar at the English language Wikipedia [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)]
8. ライブラリ
picture: David Vignoni / ICON KING (http://icon-king.com) [LGPL (http://www.gnu.org/licenses/lgpl.html) or LGPL (http://www.gnu.org/licenses/lgpl.html)]
9. バッチ処理
picture: US Social Security Administration (http://www.ssa.gov/history/acalcs.html) [Public domain]
12. 競合状態
picture: Sakurambo at English Wikipedia [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)]
31. アウト・オブ・オーダー実行
picture: Amit6, original version (File:Superscalarpipeline.png) by User:Poil (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0)]
32. CPUの相違
Type Alpha ARMv7
PA-
RISC
POWER
SPARC
RMO
SPARC
PSO
SPARC
TSO
x86
x86
oostore
AMD64 IA-64 zSeries
load-
load
Y Y Y Y Y Y Y
load-
store
Y Y Y Y Y Y Y
store-
store
Y Y Y Y Y Y Y Y
store-
load
Y Y Y Y Y Y Y Y Y Y Y Y
Atomic
(loads)
Y Y Y Y Y
Atomic
(stores)
Y Y Y Y Y Y
Depend
ent
loads
Y
instruct
ion
cache
Y Y Y Y Y Y Y Y Y Y
chart source: https://en.wikipedia.org/wiki/Memory_ordering