4. Project Valhalla
Emil Doepler - Doepler, Emil. ca. 1905. Walhall, die Götterwelt der Germanen. Martin Oldenbourg, Berlin. Photographed by Haukurth cropped by Bloodofox, Public Domain
5. Project Loom
織機
By en:Yanagawa Shigenobu - This image is available from the United States Library of Congress's Prints and Photographs division under the digital ID jpd.00091. パブリック・ドメイン, https://commons.wikimedia.org/w/index.php?curid=3505580
6. Project Panama
パナマ運河
By US DOT - https://www.transportation.gov/fastlane/expanded-canal-means-an-expanded-economy, Public Domain, https://commons.wikimedia.org/w/index.php?curid=54989250
7. Project Valhalla
Emil Doepler - Doepler, Emil. ca. 1905. Walhall, die Götterwelt der Germanen. Martin Oldenbourg, Berlin. Photographed by Haukurth cropped by Bloodofox, Public Domain
12. 余談その1(マイコン)
By Cbmeeks / processed by Pixel8 - Original uploader was Cbmeeks at en.wikipedia, CC 表示-継承 3.0, https://commons.wikimedia.org/w/index.php?curid=3672924
20. private static final Unsafe theUnsafe = new Unsafe();
public static Unsafe getUnsafe() {
Class cc = sun.reflect.Reflection.getCallerClass(2);
if (cc.getClassLoader() != null)
throw new SecurityException("Unsafe");
return theUnsafe;
}
21. Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
unsafe = (Unsafe) f.get(null);
38. class Counter {
private int c = 0;
public void increment() { c++; }
public void decrement() { c--; }
public int value() { return c; }
}
39. class SynchronizedCounter {
private int c = 0;
public synchronized void increment() { c++; }
public synchronized void decrement() { c--; }
public synchronized int value() { return c; }
}
50. class BadCounter {
private int c = 0;
public void increment() {
unsafe.getAndAddInt(this, valueOffset, 1);
}
public void decrement() {
unsafe.getAndAddInt(this, valueOffset, -1);
}
public int value() { return c; }
}
56. Da Vinci Machine Project
• Java 以外の言語を使っても、JVM はいい仮想マシン
• パフォーマンスがいい
• ポータビリティー(移植性)
• セキュリティ(バイトコード)
• 既存のフレームワークやライブラリ
By Web Gallery of Art: Image Info about artwork, Public Domain, https://commons.wikimedia.org/w/index.php?curid=15497207
70. public class Receiver {
private volatile String vfield;
private static final MethodHandle
MH_GETTER_V_FIELD;
private static final MethodHandle
MH_SETTER_V_FIELD;
78. class VHCounter {
private int c = 0;
public void increment() {
for (;;) {
int current = get();
int next = current + 1;
if (VH.compareAndSet(this, current, next))
return;
}
}
79. public void decrement() {
for (;;) {
int current = get();
int next = current - 1;
if (VH.compareAndSet(this, current, next))
return;
}
}