JVM Languages
jqa0602.txt
Associated article: Does Java Guarantee Thread Safety?
Tags: JVM Languages
Published source code accompanying the article by Peter Haggar in which he examines how Java guarantees thread safety.
Java Q&A
by Peter Haggar
Listing One
class RealTimeClock
{
private int clkID;
public int clockID()
{
return clkID;
}
public void setClockID(int id)
{
clkID =id;
}
//...
}
Listing Two
public class AtomicLong extends Thread
{
static volatile long val;
static int count =10000000;
...


