changeset 0:dd797d922f1c

Initial import.
author shade
date Thu, 04 Jul 2013 12:32:04 +0400
parents
children 3d8d789af5c5
files LICENSE ROADMAP THIRD_PARTY_README generator/pom.xml generator/src/main/java/org/openjdk/jcstress/TestGenMain.java generator/src/main/java/org/openjdk/jcstress/generator/AcqType.java generator/src/main/java/org/openjdk/jcstress/generator/Atomic_Updater_X.java generator/src/main/java/org/openjdk/jcstress/generator/Atomic_X.java generator/src/main/java/org/openjdk/jcstress/generator/Primitive.java generator/src/main/java/org/openjdk/jcstress/generator/RelType.java generator/src/main/java/org/openjdk/jcstress/generator/SynchronizedBlock.java generator/src/main/java/org/openjdk/jcstress/generator/TestGenerator.java generator/src/main/java/org/openjdk/jcstress/generator/VolatileReadWrite.java harness/pom.xml harness/src/main/java/org/openjdk/jcstress/ForkedMain.java harness/src/main/java/org/openjdk/jcstress/JCStress.java harness/src/main/java/org/openjdk/jcstress/Main.java harness/src/main/java/org/openjdk/jcstress/Options.java harness/src/main/java/org/openjdk/jcstress/infra/EndResult.java harness/src/main/java/org/openjdk/jcstress/infra/Scheduler.java harness/src/main/java/org/openjdk/jcstress/infra/State.java harness/src/main/java/org/openjdk/jcstress/infra/Status.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/DiskReadCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/DiskWriteCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/InProcessCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/MuxCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/NetworkInputCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/NetworkOutputCollector.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/TestResult.java harness/src/main/java/org/openjdk/jcstress/infra/collectors/TestResultCollector.java harness/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java harness/src/main/java/org/openjdk/jcstress/infra/grading/DescriptionReader.java harness/src/main/java/org/openjdk/jcstress/infra/grading/ExceptionReportPrinter.java harness/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java harness/src/main/java/org/openjdk/jcstress/infra/grading/TestGrading.java harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult3.java harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult8.java harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult3.java harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult3.java harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult4.java harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult1.java harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult2.java harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult4.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/ActorBase.java harness/src/main/java/org/openjdk/jcstress/infra/runners/ControlHolder.java harness/src/main/java/org/openjdk/jcstress/infra/runners/Runner.java harness/src/main/java/org/openjdk/jcstress/infra/runners/StateHolder.java harness/src/main/java/org/openjdk/jcstress/infra/runners/TerminationRunner.java harness/src/main/java/org/openjdk/jcstress/tests/Actor1_Test.java harness/src/main/java/org/openjdk/jcstress/tests/Actor2_Arbiter1_Test.java harness/src/main/java/org/openjdk/jcstress/tests/Actor2_Test.java harness/src/main/java/org/openjdk/jcstress/tests/Actor3_Test.java harness/src/main/java/org/openjdk/jcstress/tests/Actor4_Test.java harness/src/main/java/org/openjdk/jcstress/tests/ActorConcurrencyTest.java harness/src/main/java/org/openjdk/jcstress/tests/ConcurrencyTest.java harness/src/main/java/org/openjdk/jcstress/tests/TerminationTest.java harness/src/main/java/org/openjdk/jcstress/util/Bridges.java harness/src/main/java/org/openjdk/jcstress/util/CharArrayMultiSet.java harness/src/main/java/org/openjdk/jcstress/util/Counter.java harness/src/main/java/org/openjdk/jcstress/util/Counters.java harness/src/main/java/org/openjdk/jcstress/util/Environment.java harness/src/main/java/org/openjdk/jcstress/util/HashCounter.java harness/src/main/java/org/openjdk/jcstress/util/HashMultimap.java harness/src/main/java/org/openjdk/jcstress/util/HashMultiset.java harness/src/main/java/org/openjdk/jcstress/util/InputStreamDrainer.java harness/src/main/java/org/openjdk/jcstress/util/LongHashMultiset.java harness/src/main/java/org/openjdk/jcstress/util/Multimap.java harness/src/main/java/org/openjdk/jcstress/util/Multiset.java harness/src/main/java/org/openjdk/jcstress/util/Multisets.java harness/src/main/java/org/openjdk/jcstress/util/MutableLong.java harness/src/main/java/org/openjdk/jcstress/util/NonNullArrayList.java harness/src/main/java/org/openjdk/jcstress/util/NullOutputStream.java harness/src/main/java/org/openjdk/jcstress/util/Reflections.java harness/src/main/java/org/openjdk/jcstress/util/TreeMultimap.java harness/src/main/java/org/openjdk/jcstress/util/TreesetMultimap.java harness/src/main/java/org/openjdk/jcstress/util/UnsafeHolder.java harness/src/main/java/sun/misc/Contended.java harness/src/main/java/sun/misc/Unsafe.java harness/src/main/resources/xsd/descriptions/test-descriptions.xsd harness/src/main/resources/xsd/results/test-result.xsd pom.xml src/license/gpl_cpe/header.txt src/license/gpl_cpe/license.txt tests-all/pom.xml tests-all/src/main/java/Test.java tests-custom/pom.xml tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/ByteBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/ByteBufferViewsAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/CharBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/DirectByteBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/DirectByteBufferViewsAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/DoubleBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/FloatBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/IntBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/LongBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/buffers/ShortBufferAtomicityTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/crosscache/ByteBufferIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/crosscache/DirectByteBufferIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/crosscache/UnsafeIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/Constants.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/perbyte/VolatileShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/plain/VolatileShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/CharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/DoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/FloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/IntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/LongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/ShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileByteAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileCharAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileDoubleAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileFloatAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileIntAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileLongAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomicity/primitives/reflect/VolatileShortAtomicityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/booleans/AtomicBooleanInitialValueTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/booleans/AtomicBooleanPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerArrayInitialValueTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerArrayInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerArrayPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerFieldUpdaterPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerInitialValueTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/integer/AtomicIntegerPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongArrayInitialValueTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongArrayInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongArrayPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongFieldUpdaterPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongInitialValueTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/atomics/longs/AtomicLongPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/BooleanLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/ByteLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/CharLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/DoubleLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/FloatLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/IntLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/LongLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/ObjectLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/cached/ShortLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/BooleanLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/ByteLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/CharLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/DoubleLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/FloatLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/IntLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/LongLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/ObjectLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/plain/ShortLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/BooleanLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/ByteLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/CharLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/DoubleLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/FloatLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/IntLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/LongLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/ObjectLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/causality/lazyinit/volatiles/ShortLazyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/FencedAcquireReleaseTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/FencedDekkerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/FencedPublicationTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/FencedReadTwiceTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/UnfencedAcquireReleaseTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/UnfencedDekkerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/UnfencedPublicationTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/fences/UnfencedReadTwiceTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/future/FutureTaskSetTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/BooleanArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/ByteArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/CharArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/DoubleArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/FloatArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/IntArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/LongArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/ObjectArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/plain/ShortArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/BooleanArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/ByteArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/CharArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/DoubleArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/FloatArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/IntArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/LongArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/ObjectArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/arrays/volatiles/ShortArrayInitTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/BooleanFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/ByteFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/CharFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/DoubleFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/FloatFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/IntFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/LongFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/ObjectFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/plain/ShortFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/BooleanFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/ByteFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/CharFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/DoubleFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/FloatFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/IntFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/LongFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/ObjectFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/objects/volatiles/ShortFieldsTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/BooleanFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/ByteFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/CharFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/DoubleFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/FloatFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/IntFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/LongFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/fenced/ShortFencedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/BooleanFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/ByteFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/CharFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/DoubleFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/FloatFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/IntFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/LongFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/finals/ShortFinalTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/BooleanInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/ByteInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/CharInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/DoubleInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/FloatInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/IntInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/LongInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/instance/ShortInstanceInitializerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/BooleanPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/BytePlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/CharPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/DoublePlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/FloatPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/IntPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/LongPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/plain/ShortPlainTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/BooleanVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/ByteVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/CharVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/DoubleVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/FloatVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/IntVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/LongVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/init/primitives/volatiles/ShortVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/CurrentThreadIsInterruptedBreakTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/CurrentThreadIsInterruptedMethodTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/CurrentThreadIsInterruptedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ObjectWaitInfiniteTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ObjectWaitTimedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/PlainBusyLoopTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ReentrantLockInterruptiblyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ReentrantLockNonInterruptiblyTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ThreadInterruptedBreakTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ThreadInterruptedMethodTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ThreadInterruptedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/ThreadSleepTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/TimeUnitSleepTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/UnsafeBusyLoopTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/VolatileBusyLoopTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/interrupt/WeakReferenceTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/barriers/SyncBarrier0Test.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/barriers/SyncBarrier1Test.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/barriers/SyncBarrier2Test.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/barriers/SyncBarrier3Test.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/barriers/SyncBarrier4Test.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/mutex/ReentrantLockMutexTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/mutex/ReentrantRWLockMutexTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/mutex/SynchronizedMutexTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/stamped/StampedLockPairwiseTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/locks/stamped/StampedLockTransitionTests.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/AQSTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/FailingCASTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/basic/SynchronizedTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/basic/ThreadJoinTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/basic/ThreadStartTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/scratch/basic/VolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/AbstractSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/FinalWrapperSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/HolderSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/SafeDCLSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/UnsafeDCLSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/singletons/UnsafeLocalDCLSingletonTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/ArrayInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/UnsafeArrayInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/UnsafeIntTearingTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/ByteBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/CharBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/DirectByteBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/DoubleBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/FloatBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/IntBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/LongBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/tearing/buffers/ShortBufferInterleaveTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/unsafe/UnsafeAddLong1.java tests-custom/src/main/java/org/openjdk/jcstress/tests/unsafe/UnsafeAddLong42.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/DekkerTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/DoubleVolatileTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/IRIWTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/LazySetTransitivityTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/ReadAfterVolatileReadTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/ReadTwiceOverVolatileReadTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/VolatileAcquireReleaseTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/VolatileIRIWTest.java tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/VolatileIncrementAtomicityTest.java tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-boolean.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-integer-array.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-integer-updater.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-integer.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-long-array.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-long-updater.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomic-long.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomicity-buffers.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomicity-crosscache.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomicity-primitive-plain.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomicity-primitive-reflect.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/atomicity-primitive-tear.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/causality.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/fences.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/future.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/initArrays.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/initObjects.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/initialization.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/interrupts.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/locks-reentrant.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/locks-stamped.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/locks.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/scratch.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/singletons.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/tearing-buffers.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/tearing.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/unsafe.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/volatiles-iriw.xml tests-custom/src/main/resources/org/openjdk/jcstress/desc/volatiles.xml tests-custom/src/main/scratch/completable/GetConflictTests.java tests-custom/src/main/scratch/completable/GetRaceTests.java tests-custom/src/main/scratch/completable/MyThrowable.java tests-custom/src/main/scratch/completable/future-completable.xml tests-generated/pom.xml tests-generated/src/main/java/Test.java
diffstat 388 files changed, 44180 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it.  By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.  This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it.  (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.  Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights.  These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have.  You must
+make sure that they, too, receive or can get the source code.  And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software.  If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.  We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License.  The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language.  (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope.  The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program).  Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in whole or
+    in part contains or is derived from the Program or any part thereof, to be
+    licensed as a whole at no charge to all third parties under the terms of
+    this License.
+
+    c) If the modified program normally reads commands interactively when run,
+    you must cause it, when started running for such interactive use in the
+    most ordinary way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is no warranty (or
+    else, saying that you provide a warranty) and that users may redistribute
+    the program under these conditions, and telling the user how to view a copy
+    of this License.  (Exception: if the Program itself is interactive but does
+    not normally print such an announcement, your work based on the Program is
+    not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works.  But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source
+    code, which must be distributed under the terms of Sections 1 and 2 above
+    on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three years, to
+    give any third party, for a charge no more than your cost of physically
+    performing source distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of Sections 1
+    and 2 above on a medium customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer to
+    distribute corresponding source code.  (This alternative is allowed only
+    for noncommercial distribution and only if you received the program in
+    object code or executable form with such an offer, in accord with
+    Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it.  For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable.  However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License.  Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License.  However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works.  These actions are prohibited by law if you do not
+accept this License.  Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein.  You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License.  If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices.  Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded.  In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time.  Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission.  For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+    One line to give the program's name and a brief idea of what it does.
+
+    Copyright (C) <year> <name of author>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the Free
+    Software Foundation; either version 2 of the License, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+    more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc., 59
+    Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
+    software, and you are welcome to redistribute it under certain conditions;
+    type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
+is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+    'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+    signature of Ty Coon, 1 April 1989
+
+    Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+    Linking this library statically or dynamically with other modules is making
+    a combined work based on this library.  Thus, the terms and conditions of
+    the GNU General Public License cover the whole combination.
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,
+    and to copy and distribute the resulting executable under terms of your
+    choice, provided that you also meet, for each linked independent module,
+    the terms and conditions of the license of that module.  An independent
+    module is a module which is not derived from or based on this library.  If
+    you modify this library, you may extend this exception to your version of
+    the library, but you are not obligated to do so.  If you do not wish to do
+    so, delete this exception statement from your version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ROADMAP	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,312 @@
+TESTS AND HARNESS ROADMAPS
+-----------------------------------------------------------------------
+
+We can separate the tests in the several tiers. Often, it does not make
+sense to move to the next major tier if there are bugs in the lower tiers.
+
+Legend:
+ "----"    -- status is not applicable (the test group)
+ "    "    -- missing the status
+ "####"    -- needs expansion
+ "...."    -- not started
+ "DONE"    -- all planned tests are done
+ "PARTIAL" -- some of the tests are complete
+
+==== TIER 0.a: LANGUAGE FOUNDATION
+
+--------- primitives:
+ ....       default values
+---------   read/write atomicity
+ DONE         plain ops
+ DONE         volatile ops
+ DONE         per-byte plain ops
+ DONE         per-byte volatile ops
+---------   reflective read/write atomicity
+ ....         plain ops
+ ....         volatile ops
+ ....         per-byte plain ops
+ ....         per-byte volatile ops
+---------
+--------- arrays:
+ DONE       default values
+---------   read/write atomicity
+ DONE         plain ops
+ DONE         per-byte plain ops
+ ....         volatile ops
+ ....         per-byte volatile ops
+---------   reflective read/write atomicity
+ ....         plain ops
+ ....         per-byte plain ops
+ ....         volatile ops
+ ....         per-byte volatile ops
+---------   word tearing
+ ....         small arrays with plain ops
+ ....         large arrays with plain ops
+ ....         small arrays with volatile ops
+ ....         large arrays with volatile ops
+---------
+--------- objects:
+---------   initialization safety
+ DONE         instance constructors
+ DONE         instance initializers
+ DONE         final fields
+ DONE         volatile fields
+ DONE         fenced constructions
+---------   lazy initialization
+ DONE         against plain fields
+ DONE         against volatile fields
+ DONE         against cached volatile fields
+
+
+==== TIER 0.b: LANGUAGE FOUNDATION: BASIC MEMORY EFFECTS
+
+ (we need to greatly expand this)
+
+ volatiles:
+   acquire/release effects
+   non-volatile IRIW
+   volatile IRIW
+ fences
+
+==== TIER 1.a: CORE LIBRARY FOUNDATIONS: ATOMICS
+
+--------- scalars:
+---------   atomic/AtomicBoolean
+ DONE         initial value
+ DONE         pairwise operation tests
+ ....         lambda pairwise operation tests
+ ....         memory effects across the ops
+---------   atomic/AtomicInteger
+ DONE         initial value
+ DONE         pairwise operation tests
+ ....         lambda pairwise operation tests
+ ....         memory effects across the ops
+---------   atomic/AtomicLong
+ DONE         initial value
+ DONE         pairwise operation tests
+ ....         high/low word tests
+ ....         lambda pairwise operation tests
+ ....         memory effects across the ops
+---------   atomic/AtomicDouble
+ ....         initial value
+ ....         pairwise operation tests
+ ....         high/low word tests
+ ....         lambda pairwise operation tests
+ ....         memory effects across the ops
+---------   atomic/AtomicReference
+ ....         initial value
+ ....         pairwise operation tests
+ ....         lambda pairwise operation tests
+ ....         memory effects across the ops
+---------
+--------- updaters:
+---------   atomic/AtomicIntegerFieldUpdater:
+ ....         initial value
+ DONE         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ ....         interaction with the naked ops
+---------   atomic/AtomicLongFieldUpdater:
+ ....         initial value
+ DONE         pairwise operation tests
+ ....         high/low word tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ ....         interaction with the naked ops
+---------   atomic/AtomicReferenceFieldUpdater:
+ ....         initial value
+ DONE         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ ....         interaction with the naked ops
+---------
+--------- arrays:
+---------   atomic/AtomicIntegerArray:
+ DONE         initial value
+ DONE         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ DONE         word tearing
+---------   atomic/AtomicLongArray:
+ DONE         initial value
+ DONE         pairwise operation tests
+ ....         high/low word tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ DONE         word tearing
+---------   atomic/AtomicDoubleArray:
+ ....         initial value
+ ....         pairwise operation tests
+ ....         high/low word tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ ....         word tearing
+---------   atomic/AtomicReferenceArray:
+ ....         initial value
+ ....         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+ ....         word tearing
+---------
+--------- other:
+---------   atomic/AtomicMarkableReference:
+ ....         initial value
+ ....         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+---------   atomic/AtomicStampedReference
+ ....         initial value
+ ....         pairwise operation tests
+ ....         lambda pairwise operation tests?
+ ....         memory effects across the ops
+
+
+==== TIER 1.b: CORE LIBRARY FOUNDATIONS: SYNCHRONIZERS
+
+Q: tons of methods, we should probably cover the "protected" only?
+Q: we can skip it and rely on testing the implementations on higher tiers?
+
+--------- locks/AbstractQueuedSynchronizer
+ #####      TBD
+--------- locks/AbstractQueuedLongSynchronizer
+ #####      TBD
+
+==== TIER 2.a: CORE LIBRARY: LOCKS
+
+--------- synchronized
+ DONE       mutual exclusion
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       fairness
+--------- locks/ReentrantLock/non-fair
+ DONE       mutual exclusion
+ ....       memory effects across the ops
+ ....       starvation avoidance
+--------- locks/ReentrantLock/fair
+ DONE       mutual exclusion
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       fairness
+--------- locks/ReentrantReadWriteLock/non-fair
+ DONE       mutual exclusion
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       memory effects
+--------- locks/ReentrantReadWriteLock/fair
+ DONE       mutual exclusion
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       fairness
+--------- locks/StampedLock
+ DONE       mutual exclusion
+ DONE       mutual exclusion in the face of state transitions
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       fairness
+
+==== TIER 2.b: CORE LIBRARY: AUXILIARY ATOMICS
+
+--------- atomic/DoubleAccumulator
+ ....       racy updates
+ ....       racy resets
+--------- atomic/DoubleAdder
+ ....       racy updates
+ ....       racy resets
+--------- atomic/LongAccumulator
+ ....       racy updates
+ ....       racy resets
+--------- atomic/LongAdder
+ ....       racy updates
+ ....       racy resets
+
+==== TIER 2.c: CORE LIBRARY: USER SYNCHRONIZERS
+
+--------- CountDownLatch
+ ....       initial state
+ ....       all threads are unblocked
+ ....       await after zero
+ ....       memory effects across the ops
+--------- Semaphore/non-fair
+ ....       mutual exclusion
+ ....       multiple passers
+ ....       memory effects across the ops
+ ....       starvation avoidance
+ ....       fairness
+--------- CyclicBarrier
+ ####       TBD
+--------- CompletableFuture
+ ####       TBD
+--------- Phaser
+ ####       TBD
+--------- Exchanger
+ ####       TBD
+--------- FutureTask
+ ####       TBD
+
+==== TIER 3.x: CORE LIBRARY: EXECUTORS
+
+--------- ScheduledThreadPoolExecutor
+ ####       TBD
+--------- ThreadPoolExecutor
+ ####       TBD
+--------- ExecutorCompletionService
+ ####       TBD
+--------- ForkJoinPool
+ ####       TBD
+--------- ForkJoinTask
+ ####       TBD
+--------- CountedCompleter
+ ####       TBD
+--------- RecursiveAction
+ ####       TBD
+--------- RecursiveTask
+ ####       TBD
+
+==== TIER 3.x: CORE LIBRARY: CONCURRENT COLLECTIONS
+
+--------- ConcurrentHashMap
+ ####       TBD
+--------- ConcurrentNavigableMap
+ ####       TBD
+--------- ConcurrentSkipListMap
+ ####       TBD
+--------- ConcurrentSkipListSet
+ ####       TBD
+--------- CopyOnWriteArrayList
+ ####       TBD
+--------- CopyOnWriteArraySet
+ ####       TBD
+--------- ReadMostlyVector
+ ####       TBD
+
+==== TIER 3.x: CORE LIBRARY: QUEUES
+
+--------- ArrayBlockingQueue
+ ####       TBD
+--------- ConcurrentLinkedDeque
+ ####       TBD
+--------- ConcurrentLinkedQueue
+ ####       TBD
+--------- LinkedBlockingDeque
+ ####       TBD
+--------- LinkedBlockingQueue
+ ####       TBD
+--------- PriorityBlockingQueue
+ ####       TBD
+--------- SynchronousQueue
+ ####       TBD
+--------- TransferQueue
+ ####       TBD
+--------- DelayQueue
+ ####       TBD
+
+==== TIER 4.x: OTHER
+
+--------- ThreadLocalRandom
+ ####       TBD
+
+==== TIER 5.x: OTHER LIBRARY
+
+--------- java.nio.buffers
+ ####       read/write atomicity tests
+ ####       crosscache atomicity tests
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/THIRD_PARTY_README	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,29 @@
+DO NOT TRANSLATE OR LOCALIZE.
+-----------------------------
+
+%% This notice is provided with respect to JOpt-Simple v3.0.
+
+--- begin of LICENSE ---
+
+Copyright (c) SourceForge
+
+The MIT License Copyright (c) Permission is hereby granted, free of
+charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+--- end of LICENSE ---
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/pom.xml	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,125 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.openjdk.jcstress</groupId>
+    <artifactId>generator</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>Java Concurrency Stress Tests: Tests Generator</name>
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                            <basedir>${project.basedir}/src/main/</basedir>
+                            <mapping>
+                                <java>PHP</java>
+                            </mapping>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>1.7.1</version>
+                <executions>
+                    <execution>
+                        <id>testgen</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>test-gen</finalName>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>org.openjdk.jcstress.TestGenMain</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>enforce-versions</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <requireMavenVersion>
+                                    <version>3.0</version>
+                                </requireMavenVersion>
+                                <requireJavaVersion>
+                                    <version>1.8</version>
+                                </requireJavaVersion>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/TestGenMain.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress;
+
+import org.openjdk.jcstress.generator.TestGenerator;
+
+import java.io.FileNotFoundException;
+
+public class TestGenMain {
+
+    public static void main(String[] args) throws FileNotFoundException {
+        if (args.length >= 2) {
+            new TestGenerator(args[0], args[1]).run();
+        } else {
+            throw new IllegalStateException("Please provide the destination dir");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/AcqType.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public enum AcqType {
+    get,
+    CAS,
+    incrementAndGet,
+    getAndIncrement,
+    decrementAndGet,
+    getAndDecrement,
+    addAndGet,
+    getAndAdd,
+    getAndSet,
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/Atomic_Updater_X.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public class Atomic_Updater_X implements Primitive {
+
+    private String unitValue;
+    private String defaultValue;
+    private String rValue;
+    private String setValue;
+
+    private final Class<?> guardType;
+    private final Class<?> primType;
+    private final AcqType acqType;
+    private final RelType relType;
+
+    public Atomic_Updater_X(Class<?> guardType, Class<?> primType, AcqType acqType, RelType relType) {
+        this.guardType = guardType;
+        this.primType = primType;
+        this.acqType = acqType;
+        this.relType = relType;
+
+        unitValue = TestGenerator.getUnitValue(primType);
+        defaultValue = TestGenerator.getDefaultValue(primType);
+        rValue = TestGenerator.getRValue(primType);
+        setValue = TestGenerator.getSetValue(primType);
+    }
+
+    @Override
+    public String printStateField() {
+        return "final " + guardType.getSimpleName() + "<State> g = " + guardType.getSimpleName() + ".<State>newUpdater(State.class, \"v\");" + "\n"
+               + "volatile " + primType.getSimpleName() + " v;";
+    }
+
+    @Override
+    public String printAcquire(String region) {
+        switch (acqType) {
+            case CAS:
+                return String.format("r.r1 = s.g.compareAndSet(s, %s, %s) ? %s : %s; \n" + region,
+                        setValue,
+                        defaultValue,
+                        setValue,
+                        defaultValue
+                );
+            case get:
+                return "r.r1 = s.g.get(s) == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case incrementAndGet:
+                return "r.r1 = s.g.incrementAndGet(s) == (" + defaultValue + " + " + unitValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndIncrement:
+                return "r.r1 = s.g.getAndIncrement(s) == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case decrementAndGet:
+                return "r.r1 = s.g.decrementAndGet(s) == (" + defaultValue + " - " + unitValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndDecrement:
+                return "r.r1 = s.g.getAndDecrement(s) == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case addAndGet:
+                return "r.r1 = s.g.addAndGet(s, " + rValue + ") == (" + defaultValue + " + " + rValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndAdd:
+                return "r.r1 = s.g.getAndAdd(s, " + rValue + ") == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case getAndSet:
+                return "r.r1 = s.g.getAndSet(s, " + rValue + ") == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            default:
+                throw new IllegalStateException("" + acqType);
+        }
+    }
+
+    @Override
+    public String printRelease(String region) {
+        switch (relType) {
+            case set:
+                return region + "s.g.set(s, " +setValue + ");";
+            case CAS:
+                return region + "s.g.compareAndSet(s, " + defaultValue + ", " +setValue + ");";
+            case incrementAndGet:
+                return region + "s.g.incrementAndGet(s);";
+            case getAndIncrement:
+                return region + "s.g.getAndIncrement(s);";
+            case decrementAndGet:
+                return region + "s.g.decrementAndGet(s);";
+            case getAndDecrement:
+                return region + "s.g.getAndDecrement(s);";
+            case addAndGet:
+                return region + "s.g.addAndGet(s, " + rValue + ");";
+            case getAndAdd:
+                return region + "s.g.getAndAdd(s, " + rValue + ");";
+            case getAndSet:
+                return region + "s.g.getAndSet(s, " + rValue + ");";
+            default:
+                throw new IllegalStateException("" + relType);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/Atomic_X.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+import java.util.EnumSet;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class Atomic_X implements Primitive {
+
+    private String unitValue;
+    private String defaultValue;
+    private String rValue;
+    private String setValue;
+
+    private final Class<?> guardType;
+    private final Class<?> primType;
+    private final AcqType acqType;
+    private final RelType relType;
+
+    public Atomic_X(Class<?> guardType, Class<?> primType, AcqType acqType, RelType relType) {
+        this.guardType = guardType;
+        this.primType = primType;
+        this.acqType = acqType;
+        this.relType = relType;
+
+        unitValue = TestGenerator.getUnitValue(primType);
+        defaultValue = TestGenerator.getDefaultValue(primType);
+        rValue = TestGenerator.getRValue(primType);
+        setValue = TestGenerator.getSetValue(primType);
+
+        if (guardType == AtomicBoolean.class) {
+            if (!EnumSet.of(AcqType.get, AcqType.CAS).contains(acqType) ||
+                !EnumSet.of(RelType.set, RelType.CAS).contains(relType)) {
+                throw new IllegalArgumentException();
+            }
+        }
+    }
+
+    @Override
+    public String printStateField() {
+        return "final " + guardType.getSimpleName() + " g = new " + guardType.getSimpleName() + "();";
+    }
+
+    @Override
+    public String printAcquire(String region) {
+        switch (acqType) {
+            case CAS:
+                return String.format("r.r1 = s.g.compareAndSet(%s, %s) ? %s : %s; \n" + region,
+                        setValue,
+                        defaultValue,
+                        setValue,
+                        defaultValue
+                );
+            case get:
+                return "r.r1 = s.g.get() == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case incrementAndGet:
+                return "r.r1 = s.g.incrementAndGet() == (" + defaultValue + " + " + unitValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndIncrement:
+                return "r.r1 = s.g.getAndIncrement() == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case decrementAndGet:
+                return "r.r1 = s.g.decrementAndGet() == (" + defaultValue + " - " + unitValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndDecrement:
+                return "r.r1 = s.g.getAndDecrement() == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case addAndGet:
+                return "r.r1 = s.g.addAndGet(" + rValue + ") == (" + defaultValue + " + " + rValue + ") ? " + defaultValue + " : " + setValue + "; \n" + region;
+            case getAndAdd:
+                return "r.r1 = s.g.getAndAdd(" + rValue + ") == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            case getAndSet:
+                return "r.r1 = s.g.getAndSet(" + rValue + ") == " + defaultValue + "? " + defaultValue + " : " + setValue + " ; \n" + region;
+            default:
+                throw new IllegalStateException("" + acqType);
+        }
+    }
+
+    @Override
+    public String printRelease(String region) {
+        switch (relType) {
+            case set:
+                return region + "s.g.set(" +setValue + ");";
+            case CAS:
+                return region + "s.g.compareAndSet(" + defaultValue + ", " +setValue + ");";
+            case incrementAndGet:
+                return region + "s.g.incrementAndGet();";
+            case getAndIncrement:
+                return region + "s.g.getAndIncrement();";
+            case decrementAndGet:
+                return region + "s.g.decrementAndGet();";
+            case getAndDecrement:
+                return region + "s.g.getAndDecrement();";
+            case addAndGet:
+                return region + "s.g.addAndGet(" + rValue + ");";
+            case getAndAdd:
+                return region + "s.g.getAndAdd(" + rValue + ");";
+            case getAndSet:
+                return region + "s.g.getAndSet(" + rValue + ");";
+            default:
+                throw new IllegalStateException("" + relType);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/Primitive.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public interface Primitive {
+    String printStateField();
+
+    String printAcquire(String region);
+
+    String printRelease(String region);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/RelType.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public enum RelType {
+    set,
+    CAS,
+    incrementAndGet,
+    getAndIncrement,
+    decrementAndGet,
+    getAndDecrement,
+    addAndGet,
+    getAndAdd,
+    getAndSet,
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/SynchronizedBlock.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public class SynchronizedBlock implements Primitive {
+    @Override
+    public String printStateField() {
+        return "Object lock = new Object();" + "\n" + "private volatile int g1;";
+    }
+
+    @Override
+    public String printAcquire(String region) {
+        return "synchronized(s.lock) {\n" + " r.r1 = s.g1;" + region + "}";
+    }
+
+    @Override
+    public String printRelease(String region) {
+        return "synchronized(s.lock) { " + region + " s.g1 = " + TestGenerator.getSetValue(int.class) + ";" + " }";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/TestGenerator.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,394 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicLongFieldUpdater;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class TestGenerator {
+
+    private final String srcRoot;
+    private final String resRoot;
+
+    private final Set<String> generatedResults = new HashSet<String>();
+    private PrintWriter resourceWriter;
+
+    public TestGenerator(String srcRoot, String resRoot) {
+        this.srcRoot = srcRoot;
+        this.resRoot = resRoot;
+    }
+
+    public void run() throws FileNotFoundException {
+        generateMemoryEffects();
+    }
+
+    public void generateMemoryEffects() throws FileNotFoundException {
+        resourceWriter = new PrintWriter(ensureDir(resRoot + "/org/openjdk/jcstress/desc/") + "/memeffects.xml");
+        resourceWriter.println("<testsuite>");
+
+        for (Class<?> varType : Types.SUPPORTED_PRIMITIVES) {
+            for (Class<?> guardType : Types.SUPPORTED_PRIMITIVES) {
+                generate(new Types(guardType, varType), new VolatileReadWrite(guardType), "volatile_" + guardType + "_" + varType, "org.openjdk.jcstress.tests.memeffects.basic.volatiles");
+            }
+            generate(new Types(int.class, varType), new SynchronizedBlock(), "lock_" + varType, "org.openjdk.jcstress.tests.memeffects.basic.lock");
+
+            for (Class<?> guardType : Types.SUPPORTED_ATOMICS) {
+                Class<?> primType = Types.mapAtomicToPrim(guardType);
+                for (AcqType acqType : AcqType.values()) {
+                    for (RelType relType : RelType.values()) {
+                        try {
+                            generate(
+                                new Types(primType, varType),
+                                new Atomic_X(guardType, primType, acqType, relType),
+                                "atomic_" + acqType + "_" + relType + "_" + varType,
+                                "org.openjdk.jcstress.tests.memeffects.basic.atomic." + guardType.getSimpleName());
+                        } catch (IllegalArgumentException iae) {
+                            // not compatible acq/rel types, move on.
+                        }
+                    }
+                }
+            }
+
+            for (Class<?> guardType : Types.SUPPORTED_ATOMIC_UPDATERS) {
+                Class<?> primType = Types.mapAtomicToPrim(guardType);
+                for (AcqType acqType : AcqType.values()) {
+                    for (RelType relType : RelType.values()) {
+                        try {
+                            generate(
+                                new Types(primType, varType),
+                                new Atomic_Updater_X(guardType, primType, acqType, relType),
+                                "atomic_" + acqType + "_" + relType + "_" + varType,
+                                "org.openjdk.jcstress.tests.memeffects.basic.atomicupdaters." + guardType.getSimpleName());
+                        } catch (IllegalArgumentException iae) {
+                            // not compatible acq/rel types, move on.
+                        }
+                    }
+                }
+            }
+
+        }
+
+        resourceWriter.println("</testsuite>");
+        resourceWriter.close();
+    }
+
+    public String ensureDir(String path) {
+        File file = new File(path);
+        if (!file.exists()) {
+            file.mkdirs();
+        }
+        return file.getAbsolutePath();
+    }
+
+    public String generateResult(Types types) throws FileNotFoundException {
+        String name = "";
+        for (Class k : types.all()) {
+            if (k == boolean.class) name += "X";
+            if (k == byte.class)    name += "B";
+            if (k == short.class)   name += "S";
+            if (k == char.class)    name += "C";
+            if (k == int.class)     name += "I";
+            if (k == long.class)    name += "L";
+            if (k == float.class)   name += "F";
+            if (k == double.class)  name += "D";
+        }
+        name += "_Result";
+
+        // already generated
+        if (!generatedResults.add(name))
+            return name;
+
+        String pathname = ensureDir(srcRoot + "/" + "org.openjdk.jcstress.infra.results.".replaceAll("\\.", "/"));
+
+        PrintWriter pw = new PrintWriter(pathname + "/" + name + ".java");
+
+        pw.println("package org.openjdk.jcstress.infra.results;");
+        pw.println("");
+        pw.println("import java.io.Serializable;");
+        pw.println("");
+        pw.println("public class " + name + " implements Serializable {");
+
+        {
+            int n = 1;
+            for (Class k : types.all()) {
+                pw.println("    @sun.misc.Contended");
+                pw.println("    public " + k.getSimpleName() + " r" + n + ";");
+                pw.println();
+                n++;
+            }
+        }
+
+        pw.println("    public int hashCode() {");
+        pw.println("        int result = 0;");
+        {
+            int n = 1;
+            for (Class k : types.all()) {
+                if (k == boolean.class) {
+                    pw.println("        result = 31*result + (r" + n + " ? 1 : 0);");
+                }
+                if (k == byte.class || k == short.class || k == char.class || k == int.class) {
+                    pw.println("        result = 31*result + r" + n + ";");
+                }
+                if (k == long.class) {
+                    pw.println("        result = 31*result + (int) (r" + n + " ^ (r" + n + " >>> 32));");
+                }
+                if (k == double.class) {
+                    pw.println("        result = 31*result + (int) (Double.doubleToLongBits(r" + n + ") ^ (Double.doubleToLongBits(r" + n + ") >>> 32));");
+                }
+                if (k == float.class) {
+                    pw.println("        result = 31*result + (int) (Float.floatToIntBits(r" + n + ") ^ (Float.floatToIntBits(r" + n + ") >>> 32));");
+                }
+                n++;
+            }
+        }
+        pw.println("        return result;");
+        pw.println("    }");
+        pw.println();
+        pw.println("    public boolean equals(Object o) {");
+        pw.println("        if (this == o) return true;");
+        pw.println("        if (o == null || getClass() != o.getClass()) return false;");
+        pw.println();
+        pw.println("        " + name + " that = (" + name + ") o;\n");
+
+        {
+            int n = 1;
+            for (Class k : types.all()) {
+                if (k == boolean.class || k == byte.class || k == short.class || k == char.class
+                        || k == int.class || k == long.class ) {
+                    pw.println("        if (r" + n + " != that.r" + n + ") return false;");
+                }
+                if (k == double.class) {
+                    pw.println("        if (Double.compare(r" + n + ", that.r" + n + ") != 0) return false;");
+                }
+                if (k == float.class) {
+                    pw.println("        if (Float.compare(r" + n + ", that.r" + n + ") != 0) return false;");
+                }
+                n++;
+            }
+        }
+
+        pw.println("        return true;");
+        pw.println("    }");
+
+        pw.println("    public String toString() {");
+        pw.print("        return \"[\" + ");
+
+        {
+            int n = 1;
+            for (Class k : types.all()) {
+                if (n != 1)
+                    pw.print(" + \", \" + ");
+                if (k == char.class) {
+                    pw.print("(r" + n + " + 0)");
+                } else {
+                    pw.print("r" + n);
+                }
+                n++;
+            }
+            pw.println("+ \"]\";");
+        }
+
+        pw.println("    }");
+
+        pw.println("}");
+        pw.close();
+
+        return name;
+    }
+
+    public void generate(Types types, Primitive prim, String klass, String pkg) throws FileNotFoundException {
+
+        resourceWriter.println("    <test name=\"" + pkg + "." + klass + "\">\n" +
+                "        <contributed-by>Aleksey Shipilev (aleksey.shipilev@oracle.com)</contributed-by>\n" +
+                "        <description>Generated test</description>\n" +
+                "        <case>\n" +
+                "            <match>[" + getDefaultValue(types.type(0)) +", " + getDefaultValue(types.type(1))+ "]</match>\n" +
+                "            <match>[" + getDefaultValue(types.type(0)) +", " + getSetValue(types.type(1))+ "]</match>\n" +
+                "            <expect>ACCEPTABLE</expect>\n" +
+                "            <description>Seeing default guard, can see any value</description>\n" +
+                "        </case>\n" +
+                "        <case>\n" +
+                "            <match>[" + getSetValue(types.type(0)) +", " + getSetValue(types.type(1))+ "]</match>\n" +
+                "            <expect>ACCEPTABLE</expect>\n" +
+                "            <description>Seeing set guard, seeing the updated value</description>\n" +
+                "        </case>\n" +
+                "        <case>\n" +
+                "            <match>[" + getSetValue(types.type(0)) +", " + getDefaultValue(types.type(1))+ "]</match>\n" +
+                "            <expect>FORBIDDEN</expect>\n" +
+                "            <description>Seeing set guard, not seeing the updated value</description>\n" +
+                "        </case>\n" +
+                "        <unmatched>\n" +
+                "            <expect>FORBIDDEN</expect>\n" +
+                "            <description>Other cases are not expected.</description>\n" +
+                "        </unmatched>\n" +
+                "    </test>");
+
+        String resultName = generateResult(types);
+
+        String pathname = ensureDir(srcRoot + "/" + pkg.replaceAll("\\.", "/"));
+
+        PrintWriter pw = new PrintWriter(pathname + "/" + klass + ".java");
+
+        pw.println("package " + pkg +";\n" +
+                "\n" +
+                "import java.util.concurrent.*;\n" +
+                "import java.util.concurrent.atomic.*;\n" +
+                "import org.openjdk.jcstress.infra.results." + resultName + ";\n" +
+                "import org.openjdk.jcstress.tests.Actor2_Test;\n" +
+                "\n" +
+                "public class " + klass + " implements Actor2_Test<" + klass + ".State, " + resultName + "> {\n" +
+                "\n" +
+                "    @Override\n" +
+                "    public State newState() {\n" +
+                "        return new State();\n" +
+                "    }\n" +
+                "\n" +
+                "    @Override\n" +
+                "    public void actor1(State s, " + resultName +" r) {");
+
+        pw.println("        " + prim.printRelease("        s.a = " + getRValue(types.type(1)) +";"));
+
+        pw.println(
+                "    }\n" +
+                        "\n" +
+                        "    @Override\n" +
+                        "    public void actor2(State s, " + resultName +" r) {");
+
+        pw.println("        " + prim.printAcquire("        r.r2 = s.a;"));
+
+        pw.println(
+                "    }\n" +
+                        "\n" +
+                        "    @Override\n" +
+                        "    public " + resultName + " newResult() {\n" +
+                        "        return new " + resultName + "();\n" +
+                        "    }\n" +
+                        "\n" +
+                        "    public static class State {");
+
+        pw.println("        " + prim.printStateField());
+
+        pw.println("        public " + types.type(1) + " a;");
+        pw.println("    }");
+        pw.println("}");
+
+        pw.close();
+    }
+
+    public static String getDefaultValue(Class<?> k) {
+        if (k == boolean.class) return "false";
+        if (k == byte.class)    return "0";
+        if (k == short.class)   return "0";
+        if (k == char.class)    return "0";
+        if (k == int.class)     return "0";
+        if (k == long.class)    return "0";
+        if (k == float.class)   return "0.0";
+        if (k == double.class)  return "0.0";
+        return null;
+    }
+
+    public static String getSetValue(Class<?> k) {
+        if (k == boolean.class) return "true";
+        if (k == byte.class)    return "1";
+        if (k == short.class)   return "42";
+        if (k == char.class)    return "65";
+        if (k == int.class)     return "42";
+        if (k == long.class)    return "42";
+        if (k == float.class)   return "42.0";
+        if (k == double.class)  return "42.0";
+        return null;
+    }
+
+    public static String getRValue(Class<?> k) {
+        if (k == boolean.class) return "true";
+        if (k == byte.class)    return "(byte)1";
+        if (k == short.class)   return "42";
+        if (k == char.class)    return "'A'";
+        if (k == int.class)     return "42";
+        if (k == long.class)    return "42L";
+        if (k == float.class)   return "42.0f";
+        if (k == double.class)  return "42.0d";
+        return null;
+    }
+
+    public static String getUnitValue(Class<?> k) {
+        if (k == boolean.class) return "false";
+        if (k == byte.class)    return "1";
+        if (k == short.class)   return "1";
+        if (k == char.class)    return "(char)1";
+        if (k == int.class)     return "1";
+        if (k == long.class)    return "1L";
+        if (k == float.class)   return "1.0f";
+        if (k == double.class)  return "1.0d";
+        return null;
+    }
+
+    public static class Types {
+        public static final Class<?>[] SUPPORTED_PRIMITIVES =
+                new Class<?>[] { boolean.class, byte.class, short.class, char.class,
+                                 int.class, long.class, float.class, double.class};
+
+        public static final Class<?>[] SUPPORTED_ATOMICS =
+                new Class<?>[] { AtomicInteger.class, AtomicLong.class, AtomicBoolean.class };
+
+        public static final Class<?>[] SUPPORTED_ATOMIC_UPDATERS =
+                new Class<?>[] { AtomicIntegerFieldUpdater.class, AtomicLongFieldUpdater.class };
+
+        private final Class<?>[] types;
+
+        public Types(Class<?>... types) {
+            this.types = types;
+        }
+
+        public Class<?> type(int index) {
+            return types[index];
+        }
+
+        public Class[] all() {
+            return types;
+        }
+
+        public static Class<?> mapAtomicToPrim(Class<?> guardType) {
+            if (guardType == AtomicInteger.class) return int.class;
+            if (guardType == AtomicLong.class) return long.class;
+            if (guardType == AtomicBoolean.class) return boolean.class;
+            if (guardType == AtomicIntegerFieldUpdater.class) return int.class;
+            if (guardType == AtomicLongFieldUpdater.class) return long.class;
+            throw new IllegalStateException("No case");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/generator/src/main/java/org/openjdk/jcstress/generator/VolatileReadWrite.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.generator;
+
+public class VolatileReadWrite implements Primitive {
+
+    private final Class<?> type;
+
+    public VolatileReadWrite(Class<?> type) {
+        this.type = type;
+    }
+
+    @Override
+    public String printStateField() {
+        return "volatile " + type.getSimpleName() + " f;";
+    }
+
+    @Override
+    public String printAcquire(String region) {
+        return "r.r1 = s.f;\n" + region;
+    }
+
+    @Override
+    public String printRelease(String region) {
+        return region + "\ns.f = " + TestGenerator.getRValue(type) + ";";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/pom.xml	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,189 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.openjdk.jcstress</groupId>
+    <artifactId>harness</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>Java Concurrency Stress Tests: Harness</name>
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <compilerArguments>
+                        <Xlint:all/>
+                        <Werror/>
+                    </compilerArguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.7</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${project.build.directory}/generated-sources/descriptions/</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>jaxb2-maven-plugin</artifactId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <id>schema-descr</id>
+                        <goals>
+                            <goal>xjc</goal>
+                        </goals>
+                        <configuration>
+                            <packageName>org.openjdk.jcstress.schema.descr</packageName>
+                            <outputDirectory>${project.build.directory}/generated-sources/descriptions/</outputDirectory>
+                            <schemaDirectory>src/main/resources/xsd/descriptions/</schemaDirectory>
+                            <staleFile>${project.build.directory}/jaxb2/.xjcStaleFlag1</staleFile>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                            <basedir>${project.basedir}/src/main/</basedir>
+                            <mapping>
+                                <java>PHP</java>
+                            </mapping>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+<!-- Temporarily disable before we have the actual SCM -->
+<!--
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>buildnumber-maven-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <doCheck>false</doCheck>
+                    <doUpdate>false</doUpdate>
+                    <shortRevisionLength>16</shortRevisionLength>
+                </configuration>
+            </plugin>
+-->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Implementation-Build>${buildNumber}</Implementation-Build>
+                            <Build-Time>${maven.build.timestamp}</Build-Time>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>enforce-versions</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <requireMavenVersion>
+                                    <version>3.0</version>
+                                </requireMavenVersion>
+                                <requireJavaVersion>
+                                    <version>1.8</version>
+                                </requireJavaVersion>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>net.sf.jopt-simple</groupId>
+            <artifactId>jopt-simple</artifactId>
+            <version>3.0</version>
+        </dependency>
+    </dependencies>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/ForkedMain.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress;
+
+import org.openjdk.jcstress.infra.collectors.NetworkOutputCollector;
+
+/**
+ * Entry point for the forked VM run.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class ForkedMain {
+
+    public static void main(String[] args) throws Exception {
+        Options opts = new Options(args);
+        if (!opts.parse()) {
+            System.exit(1);
+        }
+
+        NetworkOutputCollector collector = new NetworkOutputCollector(opts.getHostName(), opts.getHostPort());
+        new JCStress().run(opts, true, collector);
+        collector.close();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/JCStress.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress;
+
+import org.openjdk.jcstress.infra.Scheduler;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.DiskReadCollector;
+import org.openjdk.jcstress.infra.collectors.DiskWriteCollector;
+import org.openjdk.jcstress.infra.collectors.InProcessCollector;
+import org.openjdk.jcstress.infra.collectors.MuxCollector;
+import org.openjdk.jcstress.infra.collectors.NetworkInputCollector;
+import org.openjdk.jcstress.infra.collectors.TestResult;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.infra.grading.ConsoleReportPrinter;
+import org.openjdk.jcstress.infra.grading.ExceptionReportPrinter;
+import org.openjdk.jcstress.infra.grading.HTMLReportPrinter;
+import org.openjdk.jcstress.infra.runners.Actor1_Runner;
+import org.openjdk.jcstress.infra.runners.Actor2_Arbiter1_Runner;
+import org.openjdk.jcstress.infra.runners.Actor2_Runner;
+import org.openjdk.jcstress.infra.runners.Actor3_Runner;
+import org.openjdk.jcstress.infra.runners.Actor4_Runner;
+import org.openjdk.jcstress.infra.runners.Runner;
+import org.openjdk.jcstress.infra.runners.TerminationRunner;
+import org.openjdk.jcstress.tests.Actor1_Test;
+import org.openjdk.jcstress.tests.Actor2_Arbiter1_Test;
+import org.openjdk.jcstress.tests.Actor2_Test;
+import org.openjdk.jcstress.tests.Actor3_Test;
+import org.openjdk.jcstress.tests.Actor4_Test;
+import org.openjdk.jcstress.tests.ConcurrencyTest;
+import org.openjdk.jcstress.tests.TerminationTest;
+import org.openjdk.jcstress.util.InputStreamDrainer;
+import org.openjdk.jcstress.util.Reflections;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Pattern;
+
+/**
+ * JCStress main entry point.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class JCStress {
+    final ExecutorService pool;
+    private final PrintStream out;
+    NetworkInputCollector networkCollector;
+    Scheduler scheduler;
+
+    public JCStress() {
+        this.pool = Executors.newCachedThreadPool(new ThreadFactory() {
+            private final AtomicInteger id = new AtomicInteger();
+
+            @Override
+            public Thread newThread(Runnable r) {
+                Thread t = new Thread(r);
+                t.setName("worker" + id.incrementAndGet());
+                t.setDaemon(true);
+                return t;
+            }
+        });
+        out = System.out;
+    }
+
+    public void run(Options opts) throws Exception {
+        SortedSet<Class<? extends ConcurrencyTest>> tests = filterTests(opts.getTestFilter(), ConcurrencyTest.class);
+
+        if (!opts.shouldParse()) {
+            opts.printSettingsOn(out);
+
+            ConsoleReportPrinter printer = new ConsoleReportPrinter(opts, new PrintWriter(out, true), tests.size());
+            DiskWriteCollector diskCollector = new DiskWriteCollector(opts.getResultFile());
+            TestResultCollector sink = MuxCollector.of(printer, diskCollector);
+
+            networkCollector = new NetworkInputCollector(sink);
+
+            // FIXME: Scheduler will stuck itself if there is a test requiring more than $userCPUs.
+            scheduler = new Scheduler(opts.getUserCPUs());
+
+            if (opts.shouldFork()) {
+                for (Class<? extends ConcurrencyTest> test : tests) {
+                    for (int f = 0; f < opts.getForks(); f++) {
+                        runForked(opts, test, sink);
+                    }
+                }
+            } else {
+                run(opts, tests, false, sink);
+            }
+
+            scheduler.waitFinish();
+            networkCollector.terminate();
+
+            diskCollector.close();
+        }
+
+        out.println("Reading the results back... ");
+
+        InProcessCollector collector = new InProcessCollector();
+        new DiskReadCollector(opts.getResultFile(), collector).dump();
+
+        out.println("Generating the report... ");
+
+        HTMLReportPrinter p = new HTMLReportPrinter(opts, collector);
+        p.parse();
+
+        out.println("Look at " + opts.getResultDest() + "index.html for the complete run results.");
+        out.println();
+
+        out.println("Will throw any pending exceptions at this point.");
+        ExceptionReportPrinter e = new ExceptionReportPrinter(opts, collector);
+        e.parse();
+
+        out.println("Done.");
+    }
+
+    void runForked(final Options opts, final Class<? extends ConcurrencyTest> test, final TestResultCollector collector) {
+        try {
+            scheduler.schedule(new Scheduler.ScheduledTask() {
+                @Override
+                public int getTokens() {
+                    if (Actor1_Test.class.isAssignableFrom(test)) return 1;
+                    if (Actor2_Test.class.isAssignableFrom(test)) return 2;
+                    if (Actor3_Test.class.isAssignableFrom(test)) return 3;
+                    if (Actor4_Test.class.isAssignableFrom(test)) return 4;
+                    if (Actor2_Arbiter1_Test.class.isAssignableFrom(test)) return 3;
+                    if (TerminationTest.class.isAssignableFrom(test)) return 2;
+                    return 1;
+                }
+
+                @Override
+                public void run() {
+                    runForked0(opts, test, collector);
+                }
+            });
+        } catch (InterruptedException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    void runForked0(Options opts, Class<? extends ConcurrencyTest> test, TestResultCollector collector) {
+        try {
+            Collection<String> commandString = getSeparateExecutionCommand(opts, test.getName());
+            Process p = Runtime.getRuntime().exec(commandString.toArray(new String[commandString.size()]));
+
+            InputStreamDrainer errDrainer = new InputStreamDrainer(p.getErrorStream(), out);
+            InputStreamDrainer outDrainer = new InputStreamDrainer(p.getInputStream(), out);
+
+            errDrainer.start();
+            outDrainer.start();
+
+            int ecode = p.waitFor();
+
+            if (ecode != 0) {
+                // Test had failed, record this.
+                collector.add(new TestResult(test.getName(), Status.ERROR));
+            }
+
+            errDrainer.join();
+            outDrainer.join();
+
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        } catch (InterruptedException ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public void run(Options opts, boolean alreadyForked, TestResultCollector collector) throws Exception {
+        run(opts, filterTests(opts.getTestFilter(), ConcurrencyTest.class), alreadyForked, collector);
+    }
+
+    public void async(final Runner runner) throws ExecutionException, InterruptedException {
+        if (scheduler == null) {
+            runner.run();
+            return;
+        }
+
+        scheduler.schedule(new Scheduler.ScheduledTask() {
+            @Override
+            public int getTokens() {
+                return runner.requiredThreads();
+            }
+
+            @Override
+            public void run() {
+                try {
+                    runner.run();
+                } catch (InterruptedException e) {
+                    throw new IllegalStateException(e);
+                } catch (ExecutionException e) {
+                    throw new IllegalStateException(e);
+                }
+            }
+        });
+    }
+
+    public void run(Options opts, Set<Class<? extends ConcurrencyTest>> tests, boolean alreadyForked, TestResultCollector collector) throws Exception {
+
+        for (Class<? extends ConcurrencyTest> test : tests) {
+            if (Actor2_Arbiter1_Test.class.isAssignableFrom(test)) {
+                @SuppressWarnings("unchecked")
+                Actor2_Arbiter1_Test<Object, Object> obj = (Actor2_Arbiter1_Test<Object, Object>) test.newInstance();
+                async(new Actor2_Arbiter1_Runner<Object, Object>(opts, obj, collector, pool));
+            }
+
+            if (Actor1_Test.class.isAssignableFrom(test)) {
+                @SuppressWarnings("unchecked")
+                Actor1_Test<Object, Object> obj = (Actor1_Test<Object, Object>) test.newInstance();
+                async(new Actor1_Runner<Object, Object>(opts, obj, collector, pool));
+            }
+
+            if (Actor2_Test.class.isAssignableFrom(test)) {
+                @SuppressWarnings("unchecked")
+                Actor2_Test<Object, Object> obj = (Actor2_Test<Object, Object>) test.newInstance();
+                async(new Actor2_Runner<Object, Object>(opts, obj, collector, pool));
+            }
+
+            if (Actor3_Test.class.isAssignableFrom(test)) {
+                @SuppressWarnings("unchecked")
+                Actor3_Test<Object, Object> obj = (Actor3_Test<Object, Object>) test.newInstance();
+                async(new Actor3_Runner<Object, Object>(opts, obj, collector, pool));
+            }
+
+            if (Actor4_Test.class.isAssignableFrom(test)) {
+                @SuppressWarnings("unchecked")
+                Actor4_Test<Object, Object> obj = (Actor4_Test<Object, Object>) test.newInstance();
+                async(new Actor4_Runner<Object, Object>(opts, obj, collector, pool));
+            }
+
+            if (TerminationTest.class.isAssignableFrom(test)) {
+                if (!alreadyForked && !opts.shouldNeverFork()) {
+                    for (int f = 0; f < opts.getForks(); f++) {
+                        runForked(opts, test, collector);
+                    }
+                } else {
+                    @SuppressWarnings("unchecked")
+                    TerminationTest<Object> obj = (TerminationTest<Object>) test.newInstance();
+                    async(new TerminationRunner<Object>(opts, obj, collector, pool));
+                }
+            }
+        }
+
+    }
+
+    public Collection<String> getSeparateExecutionCommand(Options opts, String test) {
+        Properties props = System.getProperties();
+        String javaHome = (String) props.get("java.home");
+        String separator = File.separator;
+        String osName = props.getProperty("os.name");
+        boolean isOnWindows = osName.contains("indows");
+        String platformSpecificBinaryPostfix = isOnWindows ? ".exe" : "";
+
+        String classPath = (String) props.get("java.class.path");
+
+        if (isOnWindows) {
+            classPath = '"' + classPath + '"';
+        }
+
+        // else find out which one parent is and use that
+        StringBuilder javaExecutable = new StringBuilder();
+        javaExecutable.append(javaHome);
+        javaExecutable.append(separator);
+        javaExecutable.append("bin");
+        javaExecutable.append(separator);
+        javaExecutable.append("java");
+        javaExecutable.append(platformSpecificBinaryPostfix);
+        String javaExecutableString = javaExecutable.toString();
+
+
+        // else use same jvm args given to this runner
+        RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
+        List<String> args = RuntimemxBean.getInputArguments();
+
+        // assemble final process command
+
+        List<String> command = new ArrayList<String>();
+        command.add(javaExecutableString);
+
+        command.addAll(args);
+
+        command.add("-cp");
+        command.add(classPath);
+        String appendJvmArgs = opts.getAppendJvmArgs();
+        if (appendJvmArgs.length() > 0) {
+            command.addAll(Arrays.asList(appendJvmArgs.split("\\s")));
+        }
+        command.add(ForkedMain.class.getName());
+        command.addAll(opts.buildForkedCmdLine());
+        command.add("-t");
+        command.add(test);
+
+        command.add("--hostName");
+        command.add(networkCollector.getHost());
+
+        command.add("--hostPort");
+        command.add(String.valueOf(networkCollector.getPort()));
+
+        return command;
+    }
+
+    static <T> SortedSet<Class<? extends T>> filterTests(final String filter, Class<T> klass) {
+        SortedSet<Class<? extends T>> s = new TreeSet<Class<? extends T>>(new Comparator<Class<? extends T>>() {
+            @Override
+            public int compare(Class<? extends T> o1, Class<? extends T> o2) {
+                return o1.getName().compareTo(o2.getName());
+            }
+        });
+
+        // speculatively handle the case when there is a direct hit
+        try {
+            @SuppressWarnings("unchecked")
+            Class<? extends T> k = (Class<? extends T>) Class.forName(filter);
+            if (klass.isAssignableFrom(k)) {
+                s.add(k);
+            }
+
+            return s;
+        } catch (ClassNotFoundException e) {
+            // continue
+        }
+
+        // God I miss both diamonds and lambdas here.
+
+        Pattern pattern = Pattern.compile(filter);
+
+        for (Class k : Reflections.findAllClassesImplementing(klass, "org.openjdk.jcstress")) {
+            if (!pattern.matcher(k.getName()).matches()) {
+                continue;
+            }
+            if (Modifier.isAbstract(k.getModifiers())) {
+                continue;
+            }
+
+            @SuppressWarnings("unchecked")
+            Class<? extends T> k1 = k;
+
+            s.add(k1);
+        }
+
+        return s;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/Main.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress;
+
+import org.openjdk.jcstress.tests.ConcurrencyTest;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+/**
+ * Main entry point.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Main {
+
+    public static void main(String[] args) throws Exception {
+        System.out.println("Java Concurrency Stress Tests");
+        System.out.println("---------------------------------------------------------------------------------");
+        printVersion(System.out);
+        System.out.println();
+
+        Options opts = new Options(args);
+        if (!opts.parse()) {
+            System.exit(1);
+        }
+
+        if (opts.shouldList()) {
+            for (Class<? extends ConcurrencyTest> test : org.openjdk.jcstress.JCStress.filterTests(opts.getTestFilter(), ConcurrencyTest.class)) {
+                System.out.println(test.getName());
+            }
+        } else {
+            new JCStress().run(opts);
+        }
+    }
+
+    static void printVersion(PrintStream out) {
+        Class clazz = Main.class;
+        String className = clazz.getSimpleName() + ".class";
+        String classPath = clazz.getResource(className).toString();
+        if (!classPath.startsWith("jar")) {
+            return;
+        }
+        String manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1) + "/META-INF/MANIFEST.MF";
+        InputStream stream = null;
+        try {
+            stream = new URL(manifestPath).openStream();
+            Manifest manifest = new Manifest(stream);
+            Attributes attr = manifest.getMainAttributes();
+            out.printf("Rev:%s, built by %s with %s at %s\n",
+                    attr.getValue("Implementation-Build"),
+                    attr.getValue("Built-By"),
+                    attr.getValue("Build-Jdk"),
+                    attr.getValue("Build-Time")
+            );
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        } finally {
+            try {
+                if (stream != null) {
+                    stream.close();
+                }
+            } catch (IOException e) {
+                // swallow
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/Options.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress;
+
+import joptsimple.OptionException;
+import joptsimple.OptionParser;
+import joptsimple.OptionSet;
+import joptsimple.OptionSpec;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+/**
+ * Options.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Options {
+    public static final String STATE_FILE = "test.state";
+
+    private String resultDir;
+    private String testFilter;
+    private int minStride, maxStride;
+    private int time;
+    private int iters;
+    private final String[] args;
+    private boolean shouldYield;
+    private boolean parse;
+    private boolean list;
+    private boolean verbose;
+    private String appendJvmArgs;
+    private int systemCPUs;
+    private int userCPUs;
+    private int forks;
+    private String mode;
+    private String hostName;
+    private Integer hostPort;
+    private boolean forceYield;
+    private boolean userYield;
+    private String resultFile;
+
+    public Options(String[] args) {
+        this.args = args;
+    }
+
+    public boolean parse() throws IOException {
+        OptionParser parser = new OptionParser();
+
+        OptionSpec<String> result = parser.accepts("r", "Destination to put the complete results into.")
+                .withRequiredArg().ofType(String.class).describedAs("dir");
+
+        OptionSpec<String> parse = parser.accepts("p", "Re-run parser on the result file, no test run.")
+                .withOptionalArg().ofType(String.class);
+
+        OptionSpec<Boolean> list = parser.accepts("l", "List the available tests matching the regexp.")
+                .withOptionalArg().ofType(Boolean.class);
+
+        OptionSpec<String> testFilter = parser.accepts("t", "Regexp selector for tests")
+                .withRequiredArg().ofType(String.class).describedAs("regexp");
+
+        OptionSpec<Integer> minStride = parser.accepts("minStride", "Min internal stride size: balances the synchronization overhead vs. accuracy.")
+                .withRequiredArg().ofType(Integer.class).describedAs("N");
+
+        OptionSpec<Integer> maxStride = parser.accepts("maxStride", "Max internal stride size: balances the synchronization overhead vs. accuracy.")
+                .withRequiredArg().ofType(Integer.class).describedAs("N");
+
+        OptionSpec<Integer> time = parser.accepts("time", "Time per iteration.")
+                .withRequiredArg().ofType(Integer.class).describedAs("ms");
+
+        OptionSpec<Integer> iters = parser.accepts("iters", "Iterations per test.")
+                .withRequiredArg().ofType(Integer.class).describedAs("N");
+
+        OptionSpec<Integer> cpus = parser.accepts("c", "Number of CPUs to use. This value can exceed real CPU count.")
+                .withRequiredArg().ofType(Integer.class).describedAs("N");
+
+        OptionSpec<Integer> sysCpus = parser.accepts("sc", "Number of CPUs in the system. Overrides auto-detection.")
+                .withRequiredArg().ofType(Integer.class).describedAs("N");
+
+        OptionSpec<Boolean> shouldYield = parser.accepts("yield", "Make yields in busy-loops.")
+                .withOptionalArg().ofType(Boolean.class);
+
+        OptionSpec<Integer> forks = parser.accepts("f", "Should fork each test N times. (\"0\" to run in the embedded mode, \"-1\" to never fork)")
+                .withOptionalArg().ofType(Integer.class);
+
+        OptionSpec<String> appendJvmArgs = parser.accepts("appendJvmArgs", "Append these arguments to the forked JVM.")
+                .withRequiredArg().ofType(String.class);
+
+        OptionSpec<String> modeStr = parser.accepts("m", "Test mode")
+                .withRequiredArg().ofType(String.class);
+
+        OptionSpec<String> hostName = parser.accepts("hostName", "(internal) Host VM address")
+                .withRequiredArg().ofType(String.class);
+
+        OptionSpec<Integer> hostPort = parser.accepts("hostPort", "(internal) Host VM port")
+                .withRequiredArg().ofType(Integer.class);
+
+        parser.accepts("v", "Be verbose.");
+        parser.accepts("h", "Print this help.");
+
+        OptionSet set;
+        try {
+            set = parser.parse(args);
+        } catch (OptionException e) {
+            System.err.println("ERROR: " + e.getMessage());
+            System.err.println();
+            parser.printHelpOn(System.err);
+            return false;
+        }
+
+        if (set.has("h")) {
+            parser.printHelpOn(System.out);
+            return false;
+        }
+
+        this.resultDir = orDefault(set.valueOf(result), "results/");
+        if (!resultDir.endsWith("/")) {
+            resultDir += "/";
+        }
+
+        this.minStride = orDefault(set.valueOf(minStride), 10);
+        this.maxStride = orDefault(set.valueOf(maxStride), 10000);
+        this.time = orDefault(set.valueOf(time), 1000);
+        this.iters = orDefault(set.valueOf(iters), 5);
+        this.testFilter = orDefault(set.valueOf(testFilter), ".*");
+
+        this.forks = orDefault(set.valueOf(forks), 1);
+        this.parse = orDefault(set.has(parse), false);
+        if (this.parse) {
+            this.resultFile = set.valueOf(parse);
+        } else {
+            this.resultFile = "jcstress." + System.currentTimeMillis();
+        }
+        this.list = orDefault(set.has(list), false);
+        this.appendJvmArgs = orDefault(set.valueOf(appendJvmArgs), "");
+        this.verbose = orDefault(set.has("v"), false);
+
+        this.hostName = set.valueOf(hostName);
+        this.hostPort = set.valueOf(hostPort);
+
+        if (!set.hasArgument(sysCpus)) {
+            this.systemCPUs = figureOutHotCPUs();
+        } else {
+            this.systemCPUs = set.valueOf(sysCpus);
+        }
+
+        if (!set.hasArgument(cpus)) {
+            this.userCPUs = this.systemCPUs;
+        } else {
+            this.userCPUs = set.valueOf(cpus);
+        }
+
+        if (userCPUs > systemCPUs) {
+            forceYield = true;
+        }
+
+        this.userYield = set.has(shouldYield);
+        this.shouldYield = orDefault(set.valueOf(shouldYield), forceYield);
+
+        mode = orDefault(modeStr.value(set), "default");
+        if (this.mode.equalsIgnoreCase("sanity")) {
+            this.time = 50;
+            this.iters = 1;
+            this.forks = 0;
+        } else
+        if (this.mode.equalsIgnoreCase("quick")) {
+            this.time = 300;
+            this.iters = 5;
+            this.forks = 0;
+        } else
+        if (this.mode.equalsIgnoreCase("default")) {
+            // do nothing
+        } else
+        if (this.mode.equalsIgnoreCase("tough")) {
+            this.time = 5000;
+            this.iters = 10;
+            this.forks = 10;
+        } else
+        if (this.mode.equalsIgnoreCase("stress")) {
+            this.time = 1000;
+            this.iters = 5;
+            this.forks = 100;
+        } else {
+            System.err.println("Unknown test mode: " + this.mode);
+            System.err.println();
+            parser.printHelpOn(System.err);
+        }
+
+        return true;
+    }
+
+    private <T> T orDefault(T t, T def) {
+        return (t != null) ? t : def;
+    }
+
+    /**
+     * Warm up the CPU schedulers, bring all the CPUs online to get the
+     * reasonable estimate of the system capacity.
+     *
+     * @return online CPU count
+     */
+    private int figureOutHotCPUs() {
+        ExecutorService service = Executors.newCachedThreadPool();
+
+        System.out.print("Figuring out CPU count...");
+
+        int warmupTime = 1000;
+        long lastChange = System.currentTimeMillis();
+
+        List<Future<?>> futures = new ArrayList<Future<?>>();
+        futures.add(service.submit(new BurningTask()));
+
+        System.out.print(".");
+
+        int max = 0;
+        while (System.currentTimeMillis() - lastChange < warmupTime) {
+            int cur = Runtime.getRuntime().availableProcessors();
+            if (cur > max) {
+                System.out.print(".");
+                max = cur;
+                lastChange = System.currentTimeMillis();
+                futures.add(service.submit(new BurningTask()));
+            }
+        }
+
+        for (Future<?> f : futures) {
+            System.out.print(".");
+            f.cancel(true);
+        }
+
+        service.shutdown();
+
+        System.out.println(" done!");
+        System.out.println();
+
+        return max;
+    }
+
+    public int getForks() {
+        return forks;
+    }
+
+    public void printSettingsOn(PrintStream out) {
+        if (forks > 0) {
+            out.println("[FORKED MODE]");
+        } else {
+            out.println("[EMBEDDED MODE]");
+        }
+        out.printf("  Test preset mode: \"%s\"\n", mode);
+        out.printf("  Writing the test results to \"%s\"\n", resultFile);
+        out.printf("  Parsing results to \"%s\"\n", resultDir);
+        out.printf("  Running each test matching \"%s\" for %d forks, %d iterations, %d ms each\n", getTestFilter(), getForks(), getIterations(), getTime());
+        out.printf("  Solo stride size will be autobalanced within [%d, %d] elements\n", getMinStride(), getMaxStride());
+        out.printf("  Hardware threads in use/available: %d/%d, ", getUserCPUs(), getSystemCPUs());
+        if (userYield) {
+            if (shouldYield) {
+                out.printf("user requested yielding in busy loops.\n");
+            } else {
+                out.printf("user disabled yielding in busy loops.\n");
+            }
+        } else {
+            if (shouldYield) {
+                out.printf("yielding was forced, more threads are requested than available.\n");
+            } else {
+                out.printf("no yielding in use.\n");
+            }
+        }
+
+        out.println();
+    }
+
+    public static class BurningTask implements Runnable {
+
+        @Override
+        public void run() {
+            while (!Thread.interrupted()); // burn;
+        }
+    }
+
+    public Collection<String> buildForkedCmdLine() {
+        // omit -f, -p, -t
+        Collection<String> cmdLine = new ArrayList<String>();
+        cmdLine.add("-r");
+        cmdLine.add(resultDir);
+        cmdLine.add("-minStride");
+        cmdLine.add(Integer.toString(minStride));
+        cmdLine.add("-maxStride");
+        cmdLine.add(Integer.toString(maxStride));
+        cmdLine.add("-time");
+        cmdLine.add(Integer.toString(time));
+        cmdLine.add("-iters");
+        cmdLine.add(Integer.toString(iters));
+        cmdLine.add("-yield");
+        cmdLine.add(Boolean.toString(shouldYield));
+        cmdLine.add("-c");
+        cmdLine.add(Integer.toString(userCPUs));
+        cmdLine.add("-sc");
+        cmdLine.add(Integer.toString(systemCPUs));
+        cmdLine.add("-f");
+        cmdLine.add("0");
+        if (verbose) cmdLine.add("-v");
+
+        return  cmdLine;
+    }
+
+    public int getMinStride() {
+        return minStride;
+    }
+
+    public int getMaxStride() {
+        return maxStride;
+    }
+
+    public String getResultDest() {
+        return resultDir;
+    }
+
+    public int getTime() {
+        return time;
+    }
+
+    public boolean shouldYield() {
+        return shouldYield;
+    }
+
+    public boolean shouldParse() {
+        return parse;
+    }
+
+    public boolean shouldList() {
+        return list;
+    }
+
+    public String getTestFilter() {
+        return testFilter;
+    }
+
+    public boolean shouldFork() {
+        return forks > 0;
+    }
+
+    public boolean shouldNeverFork() {
+        return forks < 0;
+    }
+
+    public int getIterations() {
+        return iters;
+    }
+
+    public String getAppendJvmArgs() {
+        return appendJvmArgs;
+    }
+
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+    public int getUserCPUs() {
+        return userCPUs;
+    }
+
+    public int getSystemCPUs() {
+        return systemCPUs;
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public int getHostPort() {
+        return hostPort;
+    }
+
+    public String getResultFile() {
+        return resultFile;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/EndResult.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra;
+
+import java.io.Serializable;
+
+public class EndResult implements Serializable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/Scheduler.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Scheduler.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Scheduler {
+
+    private final Semaphore sentinel;
+
+    private final ExecutorService services = Executors.newCachedThreadPool(new ThreadFactory() {
+        @Override
+        public Thread newThread(Runnable r) {
+            Thread t = new Thread(r);
+            t.setDaemon(true);
+            return t;
+        }
+    });
+
+    public Scheduler(int totalTokens) {
+        this.sentinel = new Semaphore(totalTokens);
+    }
+
+    public void schedule(final ScheduledTask task) throws InterruptedException {
+        sentinel.acquire(task.getTokens());
+        services.submit(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    task.run();
+                } finally {
+                    sentinel.release(task.getTokens());
+                }
+            }
+        });
+    }
+
+    public void waitFinish() throws InterruptedException {
+        services.shutdown();
+        services.awaitTermination(1, TimeUnit.DAYS);
+    }
+
+    public interface ScheduledTask extends Runnable {
+        int getTokens();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/State.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra;
+
+import java.io.Serializable;
+
+/**
+ * State line.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class State implements Serializable {
+    private final Object result;
+    private final long count;
+
+    public State(Object result, long count) {
+        this.result = result;
+        this.count = count;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        State state = (State) o;
+
+        if (!result.equals(state.result)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return result.hashCode();
+    }
+
+    public String getId() {
+        return String.valueOf(result);
+    }
+
+    public long getCount() {
+        return count;
+    }
+
+    public Object getKey() {
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/Status.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra;
+
+/**
+ * Test status.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public enum Status {
+    NORMAL {
+        @Override
+        public Status combine(Status other) {
+            return other;
+        }
+    },
+    API_MISMATCH {
+        @Override
+        public Status combine(Status other) {
+            if (other == ERROR) {
+                return other;
+            } else {
+                return this;
+            }
+        }
+    },
+    ERROR {
+        @Override
+        public Status combine(Status other) {
+            return this;
+        }
+    },;
+
+    public abstract Status combine(Status other);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/DiskReadCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+
+/**
+ * Reads test state from the file.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class DiskReadCollector {
+
+    private final ObjectInputStream ois;
+    private final TestResultCollector collector;
+    private final FileInputStream fis;
+
+    public DiskReadCollector(String fileName, TestResultCollector collector) throws IOException {
+        this.collector = collector;
+        File file = new File(fileName);
+        fis = new FileInputStream(file);
+        ois = new ObjectInputStream(fis);
+    }
+
+    public void dump() throws IOException, ClassNotFoundException {
+        Object o;
+        try {
+            while ((o = ois.readObject()) != null) {
+                if (o instanceof TestResult) {
+                    collector.add((TestResult) o);
+                }
+            }
+        } catch (EOFException e) {
+            // expected
+        }
+    }
+
+    public void close() {
+        try {
+            ois.close();
+        } catch (IOException e) {
+            // expected
+        }
+
+        try {
+            fis.close();
+        } catch (IOException e) {
+            // expected
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/DiskWriteCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import org.openjdk.jcstress.util.Environment;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+
+/**
+ * Dumps the test results to the disk.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class DiskWriteCollector implements TestResultCollector {
+
+    private final FileOutputStream fos;
+    private final ObjectOutputStream oos;
+    private int frames;
+
+    public DiskWriteCollector(String fileName) throws IOException {
+        File file = new File(fileName);
+        fos = new FileOutputStream(file);
+        oos = new ObjectOutputStream(fos);
+    }
+
+    @Override
+    public void add(TestResult result) {
+        synchronized (this) {
+            try {
+                // reset every once in a while to keep OIS away
+                // from leaking the object cache.
+                if ((frames++ & 0xFFF) == 0) {
+                    oos.reset();
+                }
+
+                result.setEnv(Environment.getInstance());
+
+                oos.writeObject(result);
+                oos.flush();
+                fos.flush();
+            } catch (IOException e) {
+                // expect
+            }
+        }
+    }
+
+    public void close() {
+        synchronized (this) {
+            try {
+                oos.flush();
+            } catch (IOException e) {
+                // expect
+            }
+
+            try {
+                oos.close();
+            } catch (IOException e) {
+                // expect
+            }
+
+            try {
+                fos.flush();
+            } catch (IOException e) {
+                // expect
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/InProcessCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class InProcessCollector implements TestResultCollector {
+
+    private final List<TestResult> results = Collections.synchronizedList(new ArrayList<TestResult>());
+
+    @Override
+    public void add(TestResult result) {
+        results.add(result);
+    }
+
+    public Collection<TestResult> getTestResults() {
+        return results;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/MuxCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Multiplexes multiple collectors.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class MuxCollector implements TestResultCollector {
+
+    private final List<TestResultCollector> collectors = new ArrayList<TestResultCollector>();
+
+    public MuxCollector(TestResultCollector[] args) {
+        collectors.addAll(Arrays.asList(args));
+    }
+
+    public static TestResultCollector of(TestResultCollector... args) {
+        return new MuxCollector(args);
+    }
+
+    @Override
+    public void add(TestResult result) {
+        for (TestResultCollector coll : collectors) {
+            coll.add(result);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/NetworkInputCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import org.openjdk.jcstress.infra.EndResult;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InterruptedIOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Receives the test results over the network.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class NetworkInputCollector {
+
+    private final Acceptor acceptor;
+    private final List<Reader> registeredReaders;
+    private final TestResultCollector out;
+
+    public NetworkInputCollector(TestResultCollector out) throws IOException {
+        this.out = out;
+
+        registeredReaders = Collections.synchronizedList(new ArrayList<Reader>());
+
+        acceptor = new Acceptor();
+        acceptor.start();
+    }
+
+    public void terminate() {
+        acceptor.close();
+
+        for (Reader r : registeredReaders) {
+            r.close();
+        }
+
+        try {
+            acceptor.join();
+            for (Reader r : registeredReaders) {
+                r.join();
+            }
+        } catch (InterruptedException e) {
+            // ignore
+        }
+    }
+
+    public void waitFinish() {
+        for (Iterator<Reader> iterator = registeredReaders.iterator(); iterator.hasNext(); ) {
+            Reader r = iterator.next();
+            try {
+                r.join();
+                iterator.remove();
+            } catch (InterruptedException e) {
+                // ignore
+            }
+        }
+    }
+
+    private final class Acceptor extends Thread {
+
+        private final ServerSocket server;
+
+        public Acceptor() throws IOException {
+            server = new ServerSocket(0);
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (!Thread.interrupted()) {
+                    Socket clientSocket = server.accept();
+                    Reader r = new Reader(clientSocket);
+                    registeredReaders.add(r);
+                    r.start();
+                }
+            } catch (SocketException e) {
+                // assume this is "Socket closed", return
+            } catch (IOException e) {
+                throw new IllegalStateException(e);
+            } finally {
+                close();
+            }
+        }
+
+        public String getHost() {
+            try {
+                return InetAddress.getLocalHost().getHostAddress();
+            } catch (UnknownHostException e) {
+                throw new IllegalStateException("Unable to resolve local host", e);
+            }
+        }
+
+        public int getPort() {
+            return server.getLocalPort();
+        }
+
+        public void close() {
+            try {
+                server.close();
+            } catch (IOException e) {
+                // do nothing
+            }
+        }
+    }
+
+    public String getHost() {
+        return acceptor.getHost();
+    }
+
+    public int getPort() {
+        return acceptor.getPort();
+    }
+
+    private final class Reader extends Thread {
+        private final InputStream is;
+        private final Socket socket;
+        private ObjectInputStream ois;
+
+        public Reader(Socket socket) throws IOException {
+            this.socket = socket;
+            this.is = socket.getInputStream();
+        }
+
+        @Override
+        public void run() {
+            try {
+                // late OIS initialization, otherwise we'll block reading the header
+                ois = new ObjectInputStream(is);
+
+                Object obj;
+                while ((obj = ois.readObject()) != null) {
+                    if (obj instanceof EndResult) return;
+
+                    if (obj instanceof TestResult) {
+                        out.add((TestResult) obj);
+                    }
+                }
+            } catch (EOFException e) {
+                // expect
+            } catch (ObjectStreamException e) {
+                throw new IllegalStateException(e);
+            } catch (InterruptedIOException e) {
+                throw new IllegalStateException(e);
+            } catch (IOException e) {
+                throw new IllegalStateException(e);
+            } catch (ClassNotFoundException e) {
+                throw new IllegalStateException(e);
+            } finally {
+                close();
+            }
+        }
+
+        public void close() {
+            try {
+                ois.close();
+            } catch (IOException e) {
+                // ignore
+            }
+
+            try {
+                is.close();
+            } catch (IOException e) {
+                // ignore
+            }
+
+            try {
+                socket.close();
+            } catch (IOException e) {
+                // ignore
+            }
+        }
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/NetworkOutputCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import org.openjdk.jcstress.infra.EndResult;
+
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.Socket;
+
+/**
+ * Sends the test results over the network.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class NetworkOutputCollector implements TestResultCollector {
+
+    private final ObjectOutputStream oos;
+    private final Socket clientSocket;
+
+    public NetworkOutputCollector(String hostName, int hostPort) throws IOException {
+        this.clientSocket = new Socket(hostName, hostPort);
+        this.oos = new ObjectOutputStream(clientSocket.getOutputStream());
+    }
+
+    @Override
+    public void add(TestResult result) {
+        try {
+            oos.writeObject(result);
+            oos.flush();
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    public void close() {
+        try {
+            oos.writeObject(new EndResult());
+            oos.flush();
+        } catch (IOException e) {
+            // do nothing
+        }
+
+        try {
+            oos.close();
+        } catch (IOException e) {
+            // do nothing
+        }
+
+        try {
+            clientSocket.close();
+        } catch (IOException e) {
+            // do nothing
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/TestResult.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+import org.openjdk.jcstress.infra.State;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.util.Environment;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class TestResult implements Serializable {
+
+    private static final String VM_ID = UUID.randomUUID().toString();
+
+    private final String vmID;
+    private final String name;
+    private final Map<State, State> states;
+    private volatile Environment env;
+    private final Status status;
+
+    public TestResult(String name, Status status) {
+        this.vmID = VM_ID;
+        this.name = name;
+        this.status = status;
+        this.states = new HashMap<State, State>();
+    }
+
+    public void addState(Object result, long count) {
+        State ns = new State(result, count);
+        State os = states.get(ns);
+        if (os != null) {
+            ns = new State(result, count + os.getCount());
+        }
+        states.put(ns, ns);
+    }
+
+    public void setEnv(Environment e) {
+        env = e;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Collection<State> getStates() {
+        return states.values();
+    }
+
+    public boolean isNormal() {
+        return status == Status.NORMAL;
+    }
+
+    public boolean isError() {
+        return status == Status.ERROR;
+    }
+
+    public boolean isMismatch() {
+        return status == Status.API_MISMATCH;
+    }
+
+    public Environment getEnv() {
+        return env;
+    }
+
+    public Status status() {
+        return status;
+    }
+
+    public String getVmID() {
+        return vmID;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/collectors/TestResultCollector.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.collectors;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public interface TestResultCollector {
+    void add(TestResult result);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/grading/ConsoleReportPrinter.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.grading;
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.State;
+import org.openjdk.jcstress.infra.collectors.TestResult;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.schema.descr.Case;
+import org.openjdk.jcstress.schema.descr.ExpectType;
+import org.openjdk.jcstress.schema.descr.Test;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Prints the test results to the console.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class ConsoleReportPrinter extends DescriptionReader implements TestResultCollector {
+
+    private final boolean verbose;
+    private final Options opts;
+    private final PrintWriter output;
+    private final int expectedTests;
+    private final int expectedIterations;
+    private final int expectedForks;
+
+    private AtomicLong observedResults = new AtomicLong();
+    private AtomicLong observedCount = new AtomicLong();
+
+    private final ConcurrentMap<String, TestProgress> testsProgress = new ConcurrentHashMap<String, TestProgress>();
+    private final int totalExpectedResults;
+
+    private long firstTest;
+
+    public ConsoleReportPrinter(Options opts, PrintWriter pw, int expectedTests) throws JAXBException, FileNotFoundException {
+        super();
+        this.opts = opts;
+        this.output = pw;
+        this.expectedTests = expectedTests;
+        this.expectedForks = opts.getForks();
+        this.expectedIterations = opts.getIterations();
+        this.totalExpectedResults = expectedTests * opts.getIterations() * (opts.getForks() > 0 ? opts.getForks() : 1);
+        verbose = opts.isVerbose();
+    }
+
+    @Override
+    public void add(TestResult r) {
+        if (firstTest == 0) {
+            firstTest = System.nanoTime();
+        }
+
+        TestProgress e = testsProgress.get(r.getName());
+        if (e == null) {
+            e = new TestProgress(r);
+            TestProgress exist = testsProgress.putIfAbsent(r.getName(), e);
+            e = (exist != null) ? exist : e;
+        }
+
+        if (opts.getForks() > 0) {
+            e.enregisterVM(r.getVmID());
+        } else {
+            e.enregisterVM(null);
+        }
+
+        observedResults.incrementAndGet();
+
+        for (State s : r.getStates()) {
+            observedCount.addAndGet(s.getCount());
+        }
+
+        if (verbose) {
+            output.println();
+            parseVerbose(output, r);
+        } else {
+            parseSummary(output, r);
+        }
+    }
+
+    private void parseSummary(PrintWriter output, TestResult r) {
+        if (!r.isNormal()) {
+            if (r.isError()) {
+                output.println();
+                printLine(output, "ERROR", r);
+                parseVerbose(output, r);
+                output.println();
+                return;
+            } else {
+                printLine(output, "SKIPPED", r);
+                return;
+            }
+        }
+
+        Test test = testDescriptions.get(r.getName());
+        if (test == null) {
+            output.println();
+            printLine(output, "ERROR", r);
+            parseVerbose(output, r);
+            output.println();
+        } else {
+            TestGrading grading = new TestGrading(r, test);
+            if (grading.isPassed) {
+                printLine(output, "OK", r);
+            } else {
+                output.println();
+                printLine(output, "FAILED", r);
+                parseVerbose(output, r);
+                output.println();
+            }
+        }
+    }
+
+    private PrintWriter printLine(PrintWriter output, String label, TestResult r) {
+        return output.printf(" (ETA: %10s) (R: %s) (T:%4d/%d) (F:%2d/%d) (I:%2d/%d) %9s %s\n",
+                computeETA(),
+                computeSpeed(),
+                testsProgress.size(), expectedTests, testsProgress.get(r.getName()).getVMindex(r.getVmID()), expectedForks, testsProgress.get(r.getName()).getIteration(r.getVmID()), expectedIterations,
+                "[" + label + "]", chunkName(r.getName()));
+    }
+
+    private String computeSpeed() {
+        long timeSpent = System.nanoTime() - firstTest;
+        return String.format("%3.2E", 1.0 * TimeUnit.SECONDS.toNanos(1) * observedCount.get() / timeSpent);
+    }
+
+    private String computeETA() {
+        long timeSpent = System.nanoTime() - firstTest;
+        long nsToGo = (long)(timeSpent * (1.0 * totalExpectedResults / observedResults.get() - 1));
+        if (nsToGo > 0) {
+            String result = "";
+            long days = TimeUnit.NANOSECONDS.toDays(nsToGo);
+            if (days > 0) {
+                result += days + "d+";
+                nsToGo -= TimeUnit.DAYS.toNanos(days);
+            }
+            long hours = TimeUnit.NANOSECONDS.toHours(nsToGo);
+            nsToGo -= TimeUnit.HOURS.toNanos(hours);
+
+            long minutes = TimeUnit.NANOSECONDS.toMinutes(nsToGo);
+            nsToGo -= TimeUnit.MINUTES.toNanos(minutes);
+
+            long seconds = TimeUnit.NANOSECONDS.toSeconds(nsToGo);
+
+            result += String.format("%02d:%02d:%02d", hours, minutes, seconds);
+            return result;
+        } else {
+            return "now";
+        }
+    }
+
+    private String chunkName(String name) {
+        return name.replace("org.openjdk.jcstress.tests", "o.o.j.t");
+    }
+
+    private void parseVerbose(PrintWriter output, TestResult r) {
+        int len = 35;
+
+        Test test = testDescriptions.get(r.getName());
+        if (test == null) {
+            output.printf("%" + len + "s %15s %18s %-20s\n", "Observed state", "Occurrences", "Expectation", "Interpretation");
+            for (State s : r.getStates()) {
+                    output.printf("%" + len + "s (%,13d) %18s %-40s\n",
+                            cutoff(s.getId(), len),
+                            s.getCount(),
+                            ExpectType.UNKNOWN,
+                            "N/A");
+            }
+
+            return;
+        }
+
+        output.printf("%" + len + "s %15s %18s %-20s\n", "Observed state", "Occurrences", "Expectation", "Interpretation");
+
+        List<State> unmatchedStates = new ArrayList<State>();
+        unmatchedStates.addAll(r.getStates());
+        for (Case c : test.getCase()) {
+
+            boolean matched = false;
+
+            for (State s : r.getStates()) {
+                if (c.getMatch().contains(s.getId())) {
+                    // match!
+                    output.printf("%" + len + "s (%,13d) %18s %-60s\n",
+                            cutoff(s.getId(), len),
+                            s.getCount(),
+                            c.getExpect(),
+                            cutoff(c.getDescription(), 60));
+                    matched = true;
+                    unmatchedStates.remove(s);
+                }
+            }
+
+            if (!matched) {
+                for (String m : c.getMatch()) {
+                    output.printf("%" + len + "s (%,13d) %18s %-60s\n",
+                            cutoff(m, len),
+                            0,
+                            c.getExpect(),
+                            cutoff(c.getDescription(), 60));
+                }
+            }
+        }
+
+        for (State s : unmatchedStates) {
+            output.printf("%" + len + "s (%,13d) %18s %-60s\n",
+                    cutoff(s.getId(), len),
+                    s.getCount(),
+                    test.getUnmatched().getExpect(),
+                    cutoff(test.getUnmatched().getDescription(), 60));
+        }
+
+        output.println();
+    }
+
+    private static String cutoff(String src, int len) {
+        while (src.contains("  ")) {
+            src = src.replaceAll("  ", " ");
+        }
+        String trim = src.replaceAll("\n", "").trim();
+        String substring = trim.substring(0, Math.min(len - 3, trim.length()));
+        if (!substring.equals(trim)) {
+            return substring + "...";
+        } else {
+            return substring;
+        }
+    }
+
+    private static class TestProgress {
+        private final String name;
+
+        private int currentVM;
+        private final Map<String, Integer> vmIDs = new HashMap<String, Integer>();
+        private final Map<String, Integer> iterations = new HashMap<String, Integer>();
+
+        public TestProgress(TestResult result){
+            this.name = result.getName();
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            TestProgress that = (TestProgress) o;
+
+            if (!name.equals(that.name)) return false;
+
+            return true;
+        }
+
+        @Override
+        public int hashCode() {
+            return name.hashCode();
+        }
+
+        public void enregisterVM(String vmID) {
+            if (vmID == null) return;
+            synchronized (this) {
+                Integer id = vmIDs.get(vmID);
+                if (id == null) {
+                    vmIDs.put(vmID, ++currentVM);
+                }
+                Integer iters = iterations.get(vmID);
+                if (iters == null) {
+                    iters = 0;
+                }
+                iterations.put(vmID, ++iters);
+            }
+        }
+
+        public int getVMindex(String vmID) {
+            synchronized (this) {
+                Integer id = vmIDs.get(vmID);
+                return id != null ? id : 0;
+            }
+        }
+
+        public int getIteration(String vmID) {
+            synchronized (this) {
+                Integer iters = iterations.get(vmID);
+                return iters != null ? iters : 0;
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/grading/DescriptionReader.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.grading;
+
+import org.openjdk.jcstress.schema.descr.Case;
+import org.openjdk.jcstress.schema.descr.ObjectFactory;
+import org.openjdk.jcstress.schema.descr.Template;
+import org.openjdk.jcstress.schema.descr.Test;
+import org.openjdk.jcstress.schema.descr.Testsuite;
+import org.openjdk.jcstress.util.Reflections;
+import org.xml.sax.SAXException;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.validation.SchemaFactory;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Basic reporter class which is responsible for reading test descriptions.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class DescriptionReader {
+
+    protected final Map<String, Test> testDescriptions;
+    private final Unmarshaller testSuiteUnmarshaller;
+
+    public DescriptionReader() {
+        testDescriptions = new TreeMap<String, Test>();
+        try {
+            SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+            JAXBContext jc1 = JAXBContext.newInstance(Testsuite.class.getPackage().getName());
+
+            testSuiteUnmarshaller = jc1.createUnmarshaller();
+            testSuiteUnmarshaller.setSchema(sf.newSchema(getClass().getResource("/xsd/descriptions/test-descriptions.xsd")));
+
+            readDescriptions();
+        } catch (SAXException e) {
+            throw new IllegalStateException(e);
+        } catch (JAXBException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    protected void readDescriptions() throws JAXBException {
+        for (String res : Reflections.getResources("org/openjdk/jcstress/desc", "xml")) {
+            loadDescription(res);
+        }
+    }
+
+    private void loadDescription(String name)  {
+        Testsuite suite;
+        try {
+            suite = unmarshalTestsuite(this.getClass().getResourceAsStream("/" + name));
+        } catch (JAXBException e) {
+            throw new IllegalStateException(name + ": " + e.getMessage(), e);
+        }
+
+        Map<String, Template> templates = new HashMap<String, Template>();
+        for (Template t : suite.getTemplate()) {
+            templates.put(t.getName(), t);
+        }
+
+        for (Test t : suite.getTest()) {
+            if (t.getTemplate() != null && !t.getTemplate().isEmpty()) {
+                Template template = templates.get(t.getTemplate());
+                if (template == null) {
+                    throw new IllegalStateException(name + ": template \"" + t.getTemplate() + "\" is not found");
+                }
+                mergeTemplate(t, template);
+            }
+            testDescriptions.put(t.getName(), t);
+        }
+    }
+
+    private void splitCases(Collection<Case> cases) {
+        List<Case> newCases = new ArrayList<Case>();
+        for (Case c : cases) {
+            for (String match : c.getMatch()) {
+                Case newCase = new Case();
+                newCase.getMatch().clear();
+                newCase.getMatch().add(match);
+                newCase.setDescription(c.getDescription());
+                newCase.setExpect(c.getExpect());
+                newCase.setRefs(c.getRefs());
+                newCases.add(newCase);
+            }
+        }
+        cases.clear();
+        cases.addAll(newCases);
+    }
+
+    private void mergeTemplate(Test t, Template template) {
+        if (t.getContributedBy() == null) t.setContributedBy(template.getContributedBy());
+        if (t.getDescription() == null) t.setDescription(template.getDescription());
+
+        // split the matches
+        splitCases(t.getCase());
+        splitCases(template.getCase());
+
+        // merge the matches
+        Collection<Case> newCases = new ArrayList<Case>();
+
+        Set<String> fulfilledMatches = new HashSet<String>();
+        for (Case c : t.getCase()) {
+            fulfilledMatches.add(c.getMatch().get(0));
+            newCases.add(c);
+        }
+
+        for (Case c : template.getCase()) {
+            if (fulfilledMatches.add(c.getMatch().get(0))) {
+                newCases.add(c);
+            }
+        }
+
+        t.getCase().clear();
+        t.getCase().addAll(newCases);
+
+        // merge unmatched
+        if (t.getUnmatched() == null) {
+            t.setUnmatched(template.getUnmatched());
+        }
+
+        // merge refs
+        Set<String> urls = new HashSet<String>();
+        if (t.getRefs() == null) {
+            t.setRefs(new ObjectFactory().createRef());
+        }
+        urls.addAll(t.getRefs().getUrl());
+        if (template.getRefs() != null) {
+            urls.addAll(template.getRefs().getUrl());
+        }
+        t.getRefs().getUrl().clear();
+        t.getRefs().getUrl().addAll(urls);
+    }
+
+    @SuppressWarnings("unchecked")
+    public Testsuite unmarshalTestsuite(InputStream inputStream) throws JAXBException {
+        return (Testsuite) testSuiteUnmarshaller.unmarshal(inputStream);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/grading/ExceptionReportPrinter.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.grading;
+
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.State;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.InProcessCollector;
+import org.openjdk.jcstress.infra.collectors.TestResult;
+import org.openjdk.jcstress.schema.descr.Test;
+import org.openjdk.jcstress.util.HashMultimap;
+import org.openjdk.jcstress.util.LongHashMultiset;
+import org.openjdk.jcstress.util.Multimap;
+import org.openjdk.jcstress.util.TreeMultimap;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Exception report.
+ *
+ * Throws deferred test exceptions, if any.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class ExceptionReportPrinter extends DescriptionReader {
+
+    private final List<String> failures;
+    private final InProcessCollector collector;
+
+    public ExceptionReportPrinter(Options opts, InProcessCollector collector) throws JAXBException, FileNotFoundException {
+        super();
+        this.collector = collector;
+        failures = new ArrayList<String>();
+    }
+
+    public void parse() throws FileNotFoundException, JAXBException {
+        Map<String, TestResult> results = new TreeMap<String, TestResult>();
+
+        {
+            Multimap<String, TestResult> multiResults = new HashMultimap<String, TestResult>();
+            for (TestResult r : collector.getTestResults()) {
+                multiResults.put(r.getName(), r);
+            }
+
+            for (String name : multiResults.keys()) {
+                Collection<TestResult> mergeable = multiResults.get(name);
+
+                LongHashMultiset<State> stateCounts = new LongHashMultiset<State>();
+
+                Status status = Status.NORMAL;
+                for (TestResult r : mergeable) {
+                    status = status.combine(r.status());
+                    for (State s : r.getStates()) {
+                        stateCounts.add(s, s.getCount());
+                    }
+                }
+
+                TestResult root = new TestResult(name, status);
+
+                for (State s : stateCounts.keys()) {
+                    root.addState(s.getKey(), stateCounts.count(s));
+                }
+
+                results.put(name, root);
+            }
+        }
+
+        // build prefixes
+        Multimap<String, String> packages = new TreeMultimap<String, String>();
+        for (String k : results.keySet()) {
+            String pack = k.substring(0, k.lastIndexOf("."));
+            packages.put(pack, k);
+        }
+
+        for (String k : packages.keys()) {
+            Collection<String> testNames = packages.get(k);
+            for (String testName : testNames) {
+                Test test = testDescriptions.get(testName);
+                TestResult result = results.get(testName);
+                emitTest(result, test);
+            }
+        }
+
+        // TODO: Once JDK6 is in infamy, refactor to use suppressed exceptions
+        if (!failures.isEmpty()) {
+            StringBuilder sb = new StringBuilder();
+            for (String f : failures) {
+                sb.append(f).append("\n");
+            }
+            throw new AssertionError("TEST FAILURES: \n" + sb.toString());
+        }
+    }
+
+    public void emitTest(TestResult result, Test description) throws FileNotFoundException, JAXBException {
+        if (result.isError()) {
+            failures.add(result.getName() + " is in error.");
+        }
+
+        if (result.isNormal()) {
+            if (description != null) {
+                TestGrading grading = new TestGrading(result, description);
+                if (!grading.failureMessages.isEmpty()) {
+                    for (String msg : grading.failureMessages) {
+                        failures.add(result.getName() + ": " + msg);
+                    }
+                }
+            } else {
+                failures.add("TEST BUG: " + result.getName() + " description is not found.");
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/grading/HTMLReportPrinter.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.grading;
+
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.State;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.InProcessCollector;
+import org.openjdk.jcstress.infra.collectors.TestResult;
+import org.openjdk.jcstress.schema.descr.Case;
+import org.openjdk.jcstress.schema.descr.ExpectType;
+import org.openjdk.jcstress.schema.descr.Test;
+import org.openjdk.jcstress.util.Environment;
+import org.openjdk.jcstress.util.HashMultimap;
+import org.openjdk.jcstress.util.LongHashMultiset;
+import org.openjdk.jcstress.util.Multimap;
+import org.openjdk.jcstress.util.TreeMultimap;
+
+import javax.xml.bind.JAXBException;
+import java.awt.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * Prints HTML reports.
+ *
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class HTMLReportPrinter extends DescriptionReader {
+
+    private final String resultDir;
+    private final InProcessCollector collector;
+    private int cellStyle = 1;
+
+    public HTMLReportPrinter(Options opts, InProcessCollector collector) throws JAXBException, FileNotFoundException {
+        this.collector = collector;
+        resultDir = opts.getResultDest();
+        new File(resultDir).mkdirs();
+    }
+
+    public void parse() throws FileNotFoundException, JAXBException {
+
+        Map<String, TestResult> results = new TreeMap<String, TestResult>();
+
+        {
+            Multimap<String, TestResult> multiResults = new HashMultimap<String, TestResult>();
+            for (TestResult r : collector.getTestResults()) {
+                multiResults.put(r.getName(), r);
+            }
+
+            for (String name : multiResults.keys()) {
+                Collection<TestResult> mergeable = multiResults.get(name);
+
+                LongHashMultiset<State> stateCounts = new LongHashMultiset<State>();
+                Map<String, String> envs = new HashMap<String, String>();
+
+                Status status = Status.NORMAL;
+                Environment env = null;
+                for (TestResult r : mergeable) {
+                    status = status.combine(r.status());
+                    for (State s : r.getStates()) {
+                        stateCounts.add(s, s.getCount());
+                    }
+                    env = r.getEnv();
+                }
+
+                TestResult root = new TestResult(name, status);
+
+                for (State s : stateCounts.keys()) {
+                    root.addState(s.getKey(), stateCounts.count(s));
+                }
+
+                root.setEnv(env);
+
+                results.put(name, root);
+            }
+        }
+
+        // build prefixes
+        Multimap<String, String> packages = new TreeMultimap<String, String>();
+        for (String k : results.keySet()) {
+            String pack = k.substring(0, k.lastIndexOf("."));
+            packages.put(pack, k);
+        }
+
+        PrintWriter output = new PrintWriter(resultDir + "/index.html");
+
+        output.println("\n" +
+                "<html>\n" +
+                "<head>\n" +
+                "<title>Java Concurrency Stress test report</title>\n" +
+                " <style type=\"text/css\">\n" +
+                "   table { font-size: 9pt; }\n" +
+                "   a { color: #000000; }\n" +
+                "   .progress { padding: 0px; }\n" +
+                "   .header { text-align: left; }\n" +
+                "   .section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;}\n" +
+                "   .section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;}\n" +
+                "   .cell1 { background-color: #FAFAD2; }\n" +
+                "   .cell2 { background-color: #EEE8AA; }\n" +
+                "   .passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; }\n" +
+                "   .failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; }\n" +
+                "   .passed { color: #00AA00; text-align: center; font-weight: bold; }\n" +
+                "   .failed { color: #FF0000; text-align: center; font-weight: bold; }\n" +
+                "   .special{ color: #0000FF; text-align: center; font-weight: bold; }\n" +
+                "   .endResult { font-size: 48pt; text-align: center; font-weight: bold; }\n" +
+                " </style>\n" +
+                "</head>\n" +
+                "<body>");
+
+        output.println("<table width=\"100%\" cellspacing=\"20\">");
+        output.println("<tr>");
+        output.println("<td>");
+
+        {
+            int passedCount = 0;
+            int failedCount = 0;
+            int sanityFailedCount = 0;
+            for (String k : packages.keys()) {
+                Collection<String> testNames = packages.get(k);
+                for (String testName : testNames) {
+                    Test test = testDescriptions.get(testName);
+                    TestResult result = results.get(testName);
+                    if (result.isNormal()) {
+                        if (new TestGrading(result, test).isPassed) {
+                            passedCount++;
+                        } else {
+                            failedCount++;
+                        }
+                    } else {
+                        if (result.isMismatch()) {
+                            sanityFailedCount++;
+                        } else {
+                            failedCount++;
+                        }
+                    }
+                }
+            }
+
+            int totalCount = passedCount + failedCount;
+            int passedProgress = totalCount > 0 ? (passedCount * 100 / totalCount) : 0;
+            int failedProgress = totalCount > 0 ? (failedCount * 100 / totalCount) : 100;
+
+            if (failedCount > 0) {
+                output.println("<p class=\"endResult failed\">");
+            } else {
+                output.println("<p class=\"endResult passed\">");
+            }
+            output.println("" + passedProgress + "%");
+            if (sanityFailedCount > 0) {
+                output.println(" <span class=\"special\">(" + sanityFailedCount + " tests skipped)</span>");
+            }
+            output.println("</p>");
+
+            output.println("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
+            output.println("<td nowrap><b>Overall pass rate:</b> " + passedCount + "/" + (passedCount + failedCount) + "&nbsp;</td>");
+            if (passedProgress > 0) {
+                output.println("<td width=\"" + passedProgress + "%\" class=\"passedProgress\">&nbsp;</td>");
+            }
+            if (failedProgress > 0) {
+                output.println("<td width=\"" + failedProgress + "%\" class=\"failedProgress\">&nbsp;</td>");
+            }
+            output.println("</tr></table>");
+
+            output.println("<br>");
+        }
+        output.println("</td>");
+        output.println("<td width=100>");
+
+        {
+            SortedMap<String, String> env = new TreeMap<String, String>();
+            for (String k : packages.keys()) {
+                for (String testName : packages.get(k)) {
+                    TestResult result = results.get(testName);
+                    if (result != null) {
+                        for (Map.Entry<String, String> kv : result.getEnv().entries().entrySet()) {
+                            String key = kv.getKey();
+                            String value = kv.getValue();
+                            String lastV = env.get(key);
+                            if (lastV == null) {
+                                env.put(key, value);
+                            } else {
+                                // Some VMs have these keys pre-populated with the command line,
+                                // which can have port definitions, PIDs, etc, and naturally
+                                // clash from launch to launch.
+                                if (key.equals("cmdLine")) continue;
+                                if (key.equals("launcher")) continue;
+
+                                if (!lastV.equalsIgnoreCase(value)) {
+                                    System.err.println("Mismatched environment for key = " + key + ", was = " + lastV + ", now = "  + value);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            output.println("<table>");
+            for (Map.Entry<String, String> entry : env.entrySet()) {
+                output.println("<tr>");
+                output.println("<td nowrap>" + entry.getKey() + "</td>");
+                output.println("<td>" + entry.getValue() + "</td>");
+                output.println("</tr>");
+            }
+            output.println("</table>");
+        }
+
+        output.println("</td>");
+        output.println("</tr>");
+        output.println("</table>");
+
+        output.println("<table cellspacing=0 cellpadding=0 width=\"100%\">\n" +
+                "<tr>\n" +
+                " <th class=\"header\">Test</th>\n" +
+                " <th class=\"header\">Cycles</th>\n" +
+                " <th class=\"header\">Results</th>\n" +
+                "</tr>");
+
+        for (String k : packages.keys()) {
+            emitPackage(output, k);
+
+            Collection<String> testNames = packages.get(k);
+            for (String testName : testNames) {
+                Test test = testDescriptions.get(testName);
+                TestResult result = results.get(testName);
+                if (result.isNormal()) {
+                    emitTest(output, result, test);
+                } else {
+                    emitTestFailure(output, result, test);
+                }
+
+                PrintWriter local = new PrintWriter(resultDir + "/" + testName + ".html");
+                parseTest(local, result, test);
+                local.close();
+            }
+        }
+
+        output.println("</table>");
+
+        output.println("</body>");
+        output.println("</html>");
+
+        output.close();
+    }
+
+    private void emitPackage(PrintWriter pw, String pack) {
+        pw.println("<tr class=\"section2\">\n" +
+                "   <td><b>" + pack + "</b></td>\n" +
+                "   <td>&nbsp;</td>\n" +
+                "   <td>&nbsp;</td>\n" +
+                "   <td></td>" +
+                "</tr>");
+    }
+
+    public static String cutKlass(String fqname) {
+        return fqname.substring(fqname.lastIndexOf(".") + 1);
+    }
+
+    public void emitTest(PrintWriter output, TestResult result, Test description) throws FileNotFoundException, JAXBException {
+        cellStyle = 3 - cellStyle;
+        output.println("<tr class=\"cell" + cellStyle + "\">");
+        output.println("<td>&nbsp;&nbsp;&nbsp;<a href=\"" + result.getName() + ".html\">" + cutKlass(result.getName()) + "</a></td>");
+        output.printf("<td>> 10<sup>%d</sup></td>", getRoughCount(result));
+        if (description != null) {
+            TestGrading grading = new TestGrading(result, description);
+            if (grading.isPassed) {
+                output.println("<td class=\"passed\">PASSED</td>");
+            } else {
+                output.println("<td class=\"failed\">FAILED</td>");
+            }
+
+            if (grading.isSpecial) {
+                output.println("<td class=\"special\">INTERESTING</td>");
+            } else {
+                output.println("<td class=\"special\"></td>");
+            }
+        } else {
+            output.println("<td class=\"failed\">MISSING DESCRIPTION</td>");
+            output.println("<td class=\"special\"></td>");
+        }
+        output.println("</tr>");
+    }
+
+    public void emitTestFailure(PrintWriter output, TestResult result, Test description) throws FileNotFoundException, JAXBException {
+        cellStyle = 3 - cellStyle;
+        output.println("<tr class=\"cell" + cellStyle + "\">");
+        output.println("<td>&nbsp;&nbsp;&nbsp;<a href=\"" + result.getName() + ".html\">" + cutKlass(result.getName()) + "</a></td>");
+        output.println("<td></td>");
+        if (description != null) {
+            if (result.isMismatch()) {
+                output.println("<td class=\"special\">SKIPPED</td>");
+                output.println("<td class=\"special\">Sanity check failed, API mismatch?</td>");
+            }
+            if (result.isError()) {
+                output.println("<td class=\"failed\">ERROR</td>");
+                output.println("<td class=\"failed\">Error running the test</td>");
+            }
+        } else {
+            output.println("<td class=\"failed\">MISSING DESCRIPTION</td>");
+            output.println("<td class=\"special\"></td>");
+        }
+        output.println("</tr>");
+    }
+
+    public static int getRoughCount(TestResult r) {
+        long sum = 0;
+        for (State s : r.getStates()) {
+            sum += s.getCount();
+        }
+
+        return (int) Math.floor(Math.log10(sum));
+    }
+
+
+    public void parseTest(PrintWriter output, TestResult r, Test test) throws FileNotFoundException, JAXBException {
+        if (test == null) {
+            parseTestWithoutDescription(output, r);
+            return;
+        }
+
+        output.println("<h1>" + r.getName() + "</h1>");
+
+        output.println("<p>" + test.getDescription() + "</p>");
+        output.println("<p><b>Contributed by:</b> " + test.getContributedBy() + "</p>");
+
+        output.println("<table width=100%>");
+        output.println("<tr>");
+        output.println("<th width=250>Observed state</th>");
+        output.println("<th width=50>Occurrence</th>");
+        output.println("<th width=50>Expectation</th>");
+        output.println("<th>Interpretation</th>");
+        output.println("<th width=50>Refs</th>");
+        output.println("</tr>");
+
+        List<State> unmatchedStates = new ArrayList<State>();
+        unmatchedStates.addAll(r.getStates());
+        for (Case c : test.getCase()) {
+
+            boolean matched = false;
+
+            for (State s : r.getStates()) {
+                if (c.getMatch().contains(s.getId())) {
+                    // match!
+                    output.println("<tr bgColor=" + selectHTMLColor(c.getExpect(), s.getCount() == 0) + ">");
+                    output.println("<td>" + s.getId() + "</td>");
+                    output.println("<td align=center>" + s.getCount() + "</td>");
+                    output.println("<td align=center>" + c.getExpect() + "</td>");
+                    output.println("<td>" + c.getDescription() + "</td>");
+                    output.println("<td bgColor='white'>");
+                    List<String> list = (c.getRefs() != null) ? c.getRefs().getUrl() : Collections.<String>emptyList();
+                    for (int i = 0; i < list.size(); i++) {
+                        output.println("<a href=\"" + list.get(i) + "\">[" + (i+1) + "]</a>");
+                    }
+                    output.println("</td>");
+
+                    output.println("</tr>");
+                    matched = true;
+                    unmatchedStates.remove(s);
+                }
+            }
+
+            if (!matched) {
+                for (String m : c.getMatch()) {
+                    output.println("<tr bgColor=" + selectHTMLColor(c.getExpect(), true) + ">");
+                    output.println("<td>" + m + "</td>");
+                    output.println("<td align=center>" + 0 + "</td>");
+                    output.println("<td align=center>" + c.getExpect() + "</td>");
+                    output.println("<td>" + c.getDescription() + "</td>");
+                    output.println("<td bgColor='white'>");
+                    List<String> list = (c.getRefs() != null) ? c.getRefs().getUrl() : Collections.<String>emptyList();
+                    for (int i = 0; i < list.size(); i++) {
+                        output.println("<a href=\"" + list.get(i) + "\">[" + (i+1) + "]</a>");
+                    }
+                    output.println("</td>");
+                    output.println("</tr>");
+                }
+            }
+        }
+
+        for (State s : unmatchedStates) {
+            output.println("<tr bgColor=" + selectHTMLColor(test.getUnmatched().getExpect(), s.getCount() == 0) + ">");
+            output.println("<td>" + s.getId() + "</td>");
+            output.println("<td align=center>" + s.getCount() + "</td>");
+            output.println("<td align=center>" + test.getUnmatched().getExpect() + "</td>");
+            output.println("<td>" + test.getUnmatched().getDescription() + "</td>");
+            output.println("<td bgColor='white'>");
+            List<String> list = (test.getUnmatched().getRefs() != null) ? test.getUnmatched().getRefs().getUrl() : Collections.<String>emptyList();
+            for (int i = 0; i < list.size(); i++) {
+                output.println("<a href=\"" + list.get(i) + "\">[" + (i+1) + "]</a>");
+            }
+            output.println("</td>");
+            output.println("</tr>");
+        }
+
+        output.println("</table>");
+    }
+
+    private void parseTestWithoutDescription(PrintWriter output, TestResult r) {
+        output.println("<h1>" + r.getName() + "</h1>");
+
+        output.println("<p>No description available for this test</p>");
+
+        output.println("<table width=100%>");
+        output.println("<tr>");
+        output.println("<th width=250>Observed state</th>");
+        output.println("<th width=50>Occurrence</th>");
+        output.println("<th width=50>Expectation</th>");
+        output.println("<th>Interpretation</th>");
+        output.println("<th width=50>Refs</th>");
+        output.println("</tr>");
+
+        for (State s : r.getStates()) {
+            output.println("<tr bgColor=" + selectHTMLColor(ExpectType.UNKNOWN, s.getCount() == 0) + ">");
+            output.println("<td>" + s.getId() + "</td>");
+            output.println("<td align=center>" + s.getCount() + "</td>");
+            output.println("<td align=center>" + ExpectType.UNKNOWN + "</td>");
+            output.println("<td>" + "Unknows state" + "</td>");
+            output.println("</tr>");
+        }
+        output.println("</table>");
+    }
+
+    public String selectHTMLColor(ExpectType type, boolean isZero) {
+        String rgb = Integer.toHexString(selectColor(type, isZero).getRGB());
+        return "#" + rgb.substring(2, rgb.length());
+    }
+
+    public Color selectColor(ExpectType type, boolean isZero) {
+        switch (type) {
+            case REQUIRED:
+                return isZero ? Color.RED : Color.GREEN;
+            case ACCEPTABLE:
+                return isZero ? Color.LIGHT_GRAY : Color.GREEN;
+            case FORBIDDEN:
+                return isZero ? Color.LIGHT_GRAY : Color.RED;
+            case KNOWN_ACCEPTABLE:
+                return isZero ? Color.LIGHT_GRAY : Color.CYAN;
+            case KNOWN_FORBIDDEN:
+                return isZero ? Color.LIGHT_GRAY : Color.YELLOW;
+            case UNKNOWN:
+                return Color.RED;
+            default:
+                throw new IllegalStateException();
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/grading/TestGrading.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.grading;
+
+import org.openjdk.jcstress.infra.State;
+import org.openjdk.jcstress.infra.collectors.TestResult;
+import org.openjdk.jcstress.schema.descr.Case;
+import org.openjdk.jcstress.schema.descr.ExpectType;
+import org.openjdk.jcstress.schema.descr.Test;
+import org.openjdk.jcstress.util.NonNullArrayList;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class TestGrading {
+    public boolean isPassed;
+    public boolean isSpecial;
+    public final List<String> failureMessages;
+
+    public TestGrading(TestResult r, Test test) {
+        failureMessages = new NonNullArrayList<String>();
+
+        if (test == null) {
+            isPassed = false;
+            isSpecial = false;
+            failureMessages.add("No test.");
+            return;
+        }
+
+        isPassed = true;
+        isSpecial = false;
+
+        List<State> unmatchedStates = new ArrayList<State>();
+        unmatchedStates.addAll(r.getStates());
+        for (Case c : test.getCase()) {
+            boolean matched = false;
+
+            for (State s : r.getStates()) {
+                if (c.getMatch().contains(s.getId())) {
+                    isPassed &= passed(c.getExpect(), s.getCount());
+                    isSpecial |= special(c.getExpect(), s.getCount());
+                    failureMessages.add(failureMessage(s.getId(), c.getExpect(), s.getCount()));
+                    matched = true;
+                    unmatchedStates.remove(s);
+                }
+            }
+
+            if (!matched) {
+                isPassed &= passed(c.getExpect(), 0);
+                isSpecial |= special(c.getExpect(), 0);
+                failureMessages.add(failureMessage("N/A", c.getExpect(), 0));
+            }
+        }
+
+        for (State s : unmatchedStates) {
+            isPassed &= passed(test.getUnmatched().getExpect(), s.getCount());
+            isSpecial |= special(test.getUnmatched().getExpect(), s.getCount());
+            failureMessages.add(failureMessage(s.getId(), test.getUnmatched().getExpect(), s.getCount()));
+        }
+    }
+
+    public static String failureMessage(String id, ExpectType expect, long count) {
+        if (passed(expect, count)) {
+            return null;
+        } else {
+            switch (expect) {
+                case ACCEPTABLE:
+                case KNOWN_ACCEPTABLE:
+                    return null;
+                case FORBIDDEN:
+                case KNOWN_FORBIDDEN:
+                    return "Observed forbidden state: " + id;
+                case REQUIRED:
+                    return "Have not observed required state" + id;
+                case UNKNOWN:
+                    return "Missing description";
+                default:
+                    return "Missing grading";
+            }
+        }
+    }
+
+    public static boolean passed(ExpectType expect, long count) {
+        switch (expect) {
+            case ACCEPTABLE:
+            case KNOWN_ACCEPTABLE:
+                return true;
+            case FORBIDDEN:
+            case KNOWN_FORBIDDEN:
+                return count == 0;
+            case REQUIRED:
+                return count != 0;
+            case UNKNOWN:
+                return false;
+            default:
+                throw new IllegalStateException("No grading for expect type = " + expect);
+        }
+    }
+
+    public static boolean special(ExpectType expect, long count) {
+        switch (expect) {
+            case ACCEPTABLE:
+            case REQUIRED:
+            case FORBIDDEN:
+                return false;
+            case KNOWN_ACCEPTABLE:
+                return count != 0;
+            case KNOWN_FORBIDDEN:
+                return count == 0;
+            case UNKNOWN:
+                return false;
+            default:
+                throw new IllegalStateException("No grading for expect type = " + expect);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class BooleanResult1 implements Serializable {
+
+    @Contended
+    public boolean r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BooleanResult1 that = (BooleanResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (r1 ? 1 : 0);
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class BooleanResult2 implements Serializable {
+
+    @Contended
+    public boolean r1;
+
+    @Contended
+    public boolean r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BooleanResult2 that = (BooleanResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (r1 ? 1 : 0);
+        result = 31 * result + (r2 ? 1 : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/BooleanResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class BooleanResult4 implements Serializable {
+
+    @Contended
+    public boolean r1;
+
+    @Contended
+    public boolean r2;
+
+    @Contended
+    public boolean r3;
+
+    @Contended
+    public boolean r4;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BooleanResult4 that = (BooleanResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (r1 ? 1 : 0);
+        result = 31 * result + (r2 ? 1 : 0);
+        result = 31 * result + (r3 ? 1 : 0);
+        result = 31 * result + (r4 ? 1 : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ByteResult1 implements Serializable {
+
+    @Contended
+    public byte r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ByteResult1 that = (ByteResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) r1;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ByteResult2 implements Serializable {
+
+    @Contended
+    public byte r1;
+
+    @Contended
+    public byte r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ByteResult2 that = (ByteResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = r1;
+        result = 31 * result + r2;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult3.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ByteResult3 implements Serializable {
+
+    @Contended
+    public byte r1;
+
+    @Contended
+    public byte r2;
+
+    @Contended
+    public byte r3;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ByteResult3 that = (ByteResult3) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        result = 31 * result + (int) r3;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ']';
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ByteResult4 implements Serializable {
+
+    @Contended
+    public byte r1;
+
+    @Contended
+    public byte r2;
+
+    @Contended
+    public byte r3;
+
+    @Contended
+    public byte r4;
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ByteResult4 that = (ByteResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = r1;
+        result = 31 * result + r2;
+        result = 31 * result + r3;
+        result = 31 * result + r4;
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ByteResult8.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ByteResult8 implements Serializable {
+
+    @Contended
+    public byte r1;
+
+    @Contended
+    public byte r2;
+
+    @Contended
+    public byte r3;
+
+    @Contended
+    public byte r4;
+
+    @Contended
+    public byte r5;
+
+    @Contended
+    public byte r6;
+
+    @Contended
+    public byte r7;
+
+    @Contended
+    public byte r8;
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ", " + r5 + ", " + r6 + ", " + r7 + ", " + r8 + ']';
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ByteResult8 that = (ByteResult8) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+        if (r5 != that.r5) return false;
+        if (r6 != that.r6) return false;
+        if (r7 != that.r7) return false;
+        if (r8 != that.r8) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        result = 31 * result + (int) r3;
+        result = 31 * result + (int) r4;
+        result = 31 * result + (int) r5;
+        result = 31 * result + (int) r6;
+        result = 31 * result + (int) r7;
+        result = 31 * result + (int) r8;
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class CharResult1 implements Serializable {
+
+    @Contended
+    public char r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        CharResult1 that = (CharResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) r1;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class CharResult2 implements Serializable {
+
+    @Contended
+    public char r1;
+
+    @Contended
+    public char r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        CharResult2 that = (CharResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/CharResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class CharResult4 implements Serializable {
+
+    @Contended
+    public char r1;
+
+    @Contended
+    public char r2;
+
+    @Contended
+    public char r3;
+
+    @Contended
+    public char r4;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        CharResult4 that = (CharResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        result = 31 * result + (int) r3;
+        result = 31 * result + (int) r4;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class DoubleResult1 implements Serializable {
+
+    @Contended
+    public double r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        DoubleResult1 that = (DoubleResult1) o;
+
+        if (Double.compare(that.r1, r1) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        long temp = r1 != +0.0d ? Double.doubleToLongBits(r1) : 0L;
+        return (int) (temp ^ (temp >>> 32));
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class DoubleResult2 implements Serializable {
+
+    @Contended
+    public double r1;
+
+    @Contended
+    public double r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        DoubleResult2 that = (DoubleResult2) o;
+
+        if (Double.compare(that.r1, r1) != 0) return false;
+        if (Double.compare(that.r2, r2) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result;
+        long temp;
+        temp = r1 != +0.0d ? Double.doubleToLongBits(r1) : 0L;
+        result = (int) (temp ^ (temp >>> 32));
+        temp = r2 != +0.0d ? Double.doubleToLongBits(r2) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/DoubleResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class DoubleResult4 implements Serializable {
+
+    @Contended
+    public double r1;
+
+    @Contended
+    public double r2;
+
+    @Contended
+    public double r3;
+
+    @Contended
+    public double r4;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        DoubleResult4 that = (DoubleResult4) o;
+
+        if (Double.compare(that.r1, r1) != 0) return false;
+        if (Double.compare(that.r2, r2) != 0) return false;
+        if (Double.compare(that.r3, r3) != 0) return false;
+        if (Double.compare(that.r4, r4) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result;
+        long temp;
+        temp = r1 != +0.0d ? Double.doubleToLongBits(r1) : 0L;
+        result = (int) (temp ^ (temp >>> 32));
+        temp = r2 != +0.0d ? Double.doubleToLongBits(r2) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        temp = r3 != +0.0d ? Double.doubleToLongBits(r3) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        temp = r4 != +0.0d ? Double.doubleToLongBits(r4) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class FloatResult1 implements Serializable {
+
+    @Contended
+    public float r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        FloatResult1 that = (FloatResult1) o;
+
+        if (Float.compare(that.r1, r1) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (r1 != +0.0f ? Float.floatToIntBits(r1) : 0);
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class FloatResult2 implements Serializable {
+
+    @Contended
+    public float r1;
+
+    @Contended
+    public float r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        FloatResult2 that = (FloatResult2) o;
+
+        if (Float.compare(that.r1, r1) != 0) return false;
+        if (Float.compare(that.r2, r2) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (r1 != +0.0f ? Float.floatToIntBits(r1) : 0);
+        result = 31 * result + (r2 != +0.0f ? Float.floatToIntBits(r2) : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/FloatResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class FloatResult4 implements Serializable {
+
+    @Contended
+    public float r1;
+
+    @Contended
+    public float r2;
+
+    @Contended
+    public float r3;
+
+    @Contended
+    public float r4;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        FloatResult4 that = (FloatResult4) o;
+
+        if (Float.compare(that.r1, r1) != 0) return false;
+        if (Float.compare(that.r2, r2) != 0) return false;
+        if (Float.compare(that.r3, r3) != 0) return false;
+        if (Float.compare(that.r4, r4) != 0) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (r1 != +0.0f ? Float.floatToIntBits(r1) : 0);
+        result = 31 * result + (r2 != +0.0f ? Float.floatToIntBits(r2) : 0);
+        result = 31 * result + (r3 != +0.0f ? Float.floatToIntBits(r3) : 0);
+        result = 31 * result + (r4 != +0.0f ? Float.floatToIntBits(r4) : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class IntResult1 implements Serializable {
+
+    @Contended
+    public int r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        IntResult1 that = (IntResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return r1;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class IntResult2 implements Serializable {
+
+    @Contended
+    public int r1;
+
+    @Contended
+    public int r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        IntResult2 that = (IntResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = r1;
+        result = 31 * result + r2;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult3.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class IntResult3 implements Serializable {
+
+    @Contended
+    public int r1;
+
+    @Contended
+    public int r2;
+
+    @Contended
+    public int r3;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        IntResult3 that = (IntResult3) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = r1;
+        result = 31 * result + r2;
+        result = 31 * result + r3;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ']';
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/IntResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class IntResult4 implements Serializable {
+
+    @Contended
+    public int r1;
+
+    @Contended
+    public int r2;
+
+    @Contended
+    public int r3;
+
+    @Contended
+    public int r4;
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        IntResult4 that = (IntResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = r1;
+        result = 31 * result + r2;
+        result = 31 * result + r3;
+        result = 31 * result + r4;
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class LongResult1 implements Serializable {
+
+    @Contended
+    public long r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        LongResult1 that = (LongResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) (r1 ^ (r1 >>> 32));
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class LongResult2 implements Serializable {
+
+    @Contended
+    public long r1;
+
+    @Contended
+    public long r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        LongResult2 that = (LongResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) (r1 ^ (r1 >>> 32));
+        result = 31 * result + (int) (r2 ^ (r2 >>> 32));
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult3.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class LongResult3 implements Serializable {
+
+    @Contended
+    public long r1;
+
+    @Contended
+    public long r2;
+
+    @Contended
+    public long r3;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        LongResult3 that = (LongResult3) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) (r1 ^ (r1 >>> 32));
+        result = 31 * result + (int) (r2 ^ (r2 >>> 32));
+        result = 31 * result + (int) (r3 ^ (r3 >>> 32));
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ']';
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/LongResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class LongResult4 implements Serializable {
+
+    @Contended
+    public long r1;
+
+    @Contended
+    public long r2;
+
+    @Contended
+    public long r3;
+
+    @Contended
+    public long r4;
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        LongResult4 that = (LongResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) (r1 ^ (r1 >>> 32));
+        result = 31 * result + (int) (r2 ^ (r2 >>> 32));
+        result = 31 * result + (int) (r3 ^ (r3 >>> 32));
+        result = 31 * result + (int) (r4 ^ (r4 >>> 32));
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult1.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ShortResult1 implements Serializable {
+
+    @Contended
+    public short r1;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ShortResult1 that = (ShortResult1) o;
+
+        if (r1 != that.r1) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) r1;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult2.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ShortResult2 implements Serializable {
+
+    @Contended
+    public short r1;
+
+    @Contended
+    public short r2;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ShortResult2 that = (ShortResult2) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2  + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/results/ShortResult4.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.results;
+
+import sun.misc.Contended;
+
+import java.io.Serializable;
+
+public class ShortResult4 implements Serializable {
+
+    @Contended
+    public short r1;
+
+    @Contended
+    public short r2;
+
+    @Contended
+    public short r3;
+
+    @Contended
+    public short r4;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ShortResult4 that = (ShortResult4) o;
+
+        if (r1 != that.r1) return false;
+        if (r2 != that.r2) return false;
+        if (r3 != that.r3) return false;
+        if (r4 != that.r4) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = (int) r1;
+        result = 31 * result + (int) r2;
+        result = 31 * result + (int) r3;
+        result = 31 * result + (int) r4;
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "[" + r1 + ", " + r2 + ", " + r3 + ", " + r4 + ']';
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.runners;
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.tests.Actor1_Test;
+import org.openjdk.jcstress.util.Counter;
+import org.openjdk.jcstress.util.Counters;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Actor1_Runner<S, R> extends Runner {
+    private final Actor1_Test<S, R> test;
+
+    public Actor1_Runner(Options opts, Actor1_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
+        super(opts, collector, pool);
+        this.test = test;
+    }
+
+    /**
+     * Run the test.
+     * This method blocks until test is complete
+     *
+     * @throws InterruptedException
+     * @throws java.util.concurrent.ExecutionException
+     *
+     */
+    public void run() throws ExecutionException, InterruptedException {
+        testLog.println("Running " + test.getClass().getName());
+
+        Status status = checkRun(test);
+        if (status != Status.NORMAL) {
+            testLog.println("Test sanity check failed, skipping");
+            testLog.println();
+            dumpFailure(test, status);
+            return;
+        }
+
+        testLog.print("Iterations ");
+        for (int c = 0; c < iters; c++) {
+            testLog.print(".");
+            testLog.flush();
+            Counter<R> runResult = run(time);
+
+            dump(test, runResult);
+
+            System.gc();
+        }
+        testLog.println();
+    }
+
+    @Override
+    public int requiredThreads() {
+        return 1;
+    }
+
+
+    private <S, R> Status checkRun(Actor1_Test<S, R> test) {
+        try {
+            R res1 = test.newResult();
+            S state = test.newState();
+            test.actor1(state, res1);
+            return Status.NORMAL;
+        } catch (NoClassDefFoundError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchFieldError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchMethodError e) {
+            return Status.API_MISMATCH;
+        } catch (Throwable e) {
+            return Status.ERROR;
+        }
+    }
+
+    private Counter<R> run(int time) throws InterruptedException, ExecutionException {
+
+        @SuppressWarnings("unchecked")
+        final S[] poison = (S[]) new Object[0];
+
+        ControlHolder controlHolder = new ControlHolder(minStride, maxStride, shouldYield);
+
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
+
+        @SuppressWarnings("unchecked")
+        final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
+
+        @SuppressWarnings("unchecked")
+        S[] newStride = (S[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newStride[c] = test.newState();
+        }
+
+        @SuppressWarnings("unchecked")
+        R[] newResult = (R[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newResult[c] = test.newResult();
+        }
+
+        StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 1);
+        version.set(holder);
+
+        AtomicInteger epoch = new AtomicInteger();
+
+        tasks.add(pool.submit(
+                new ActorBase<Actor1_Test<S, R>, S, R>(1, test, version, epoch, counter, controlHolder, poison) {
+                    @Override
+                    protected void work1(Actor1_Test<S, R> test, S state, R result) {
+                        test.actor1(state, result);
+                    }
+                }
+        ));
+
+        TimeUnit.MILLISECONDS.sleep(time);
+
+        controlHolder.isStopped = true;
+
+        if (!waitFor(tasks)) {
+            dumpFailure(test, Status.ERROR);
+        }
+
+        return counter;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.runners;
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.tests.Actor2_Arbiter1_Test;
+import org.openjdk.jcstress.util.Counter;
+import org.openjdk.jcstress.util.Counters;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Actor2_Arbiter1_Runner<S, R> extends Runner {
+    private Actor2_Arbiter1_Test<S, R> test;
+
+    public Actor2_Arbiter1_Runner(Options opts, Actor2_Arbiter1_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
+        super(opts, collector, pool);
+        this.test = test;
+    }
+
+    public void run() throws InterruptedException, ExecutionException {
+        testLog.println("Running " + test.getClass().getName());
+
+        Status status = checkRun(test);
+        if (status != Status.NORMAL) {
+            testLog.println("Test sanity check failed, skipping");
+            testLog.println();
+            dumpFailure(test, status);
+            return;
+        }
+
+        testLog.print("Iterations ");
+        for (int c = 0; c < iters; c++) {
+            testLog.print(".");
+            testLog.flush();
+            Counter<R> runResult = run(time);
+
+            dump(test, runResult);
+
+            System.gc();
+        }
+
+        testLog.println();
+    }
+
+    @Override
+    public int requiredThreads() {
+        return 3;
+    }
+
+    private <S, R> Status checkRun(Actor2_Arbiter1_Test<S, R> test) {
+        try {
+            R res = test.newResult();
+            S state = test.newState();
+            test.actor1(state, res);
+            test.actor2(state, res);
+            test.arbiter1(state, res);
+            return Status.NORMAL;
+        } catch (NoClassDefFoundError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchFieldError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchMethodError e) {
+            return Status.API_MISMATCH;
+        } catch (Throwable e) {
+            return Status.ERROR;
+        }
+    }
+
+    public Counter<R> run(int time) throws InterruptedException, ExecutionException {
+        @SuppressWarnings("unchecked")
+        final S[] poison = (S[]) new Object[0];
+
+        ControlHolder controlHolder = new ControlHolder(minStride, maxStride, shouldYield);
+
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
+
+        @SuppressWarnings("unchecked")
+        final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
+
+        @SuppressWarnings("unchecked")
+        S[] newStride = (S[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newStride[c] = test.newState();
+        }
+
+        @SuppressWarnings("unchecked")
+        R[] newResult = (R[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newResult[c] = test.newResult();
+        }
+
+        StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 2);
+        version.set(holder);
+
+        AtomicInteger epoch = new AtomicInteger();
+
+        Future<?> a1 = pool.submit(
+                new ActorBase<Actor2_Arbiter1_Test<S, R>, S, R>(1, test, version, epoch, counter, controlHolder, poison) {
+                    @Override
+                    protected void work1(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
+                        test.actor1(state, result);
+                    }
+
+                    @Override
+                    protected void arbitrate(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
+                        test.arbiter1(state, result);
+                    }
+                }
+        );
+        tasks.add(a1);
+
+        Future<?> a2 = pool.submit(
+                new ActorBase<Actor2_Arbiter1_Test<S, R>, S, R>(2, test, version, epoch, counter, controlHolder, poison) {
+                    @Override
+                    protected void work2(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
+                        test.actor2(state, result);
+                    }
+
+                    @Override
+                    protected void arbitrate(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
+                        test.arbiter1(state, result);
+                    }
+                }
+        );
+        tasks.add(a2);
+
+        TimeUnit.MILLISECONDS.sleep(time);
+
+        controlHolder.isStopped = true;
+
+        if (!waitFor(tasks)) {
+            dumpFailure(test, Status.ERROR);
+        }
+
+        return counter;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.runners;
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.tests.Actor2_Test;
+import org.openjdk.jcstress.util.Counter;
+import org.openjdk.jcstress.util.Counters;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Actor2_Runner<S, R> extends Runner {
+    final Actor2_Test<S, R> test;
+
+    public Actor2_Runner(Options opts, Actor2_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
+        super(opts, collector, pool);
+        this.test = test;
+    }
+
+    /**
+     * Run the test.
+     * This method blocks until test is complete
+     *
+     * @throws InterruptedException
+     * @throws java.util.concurrent.ExecutionException
+     *
+     */
+    public void run() throws ExecutionException, InterruptedException {
+        testLog.println("Running " + test.getClass().getName());
+
+        Status status = checkRun();
+        if (status != Status.NORMAL) {
+            testLog.println("Test sanity check failed, skipping");
+            testLog.println();
+            dumpFailure(test, status);
+            return;
+        }
+
+        testLog.print("Iterations ");
+        for (int c = 0; c < iters; c++) {
+            testLog.print(".");
+            testLog.flush();
+            Counter<R> runResult = run(time);
+
+            dump(test, runResult);
+
+            System.gc();
+        }
+        testLog.println();
+    }
+
+    @Override
+    public int requiredThreads() {
+        return 2;
+    }
+
+    private Status checkRun() {
+        try {
+            R res1 = test.newResult();
+            R res2 = test.newResult();
+            S state = test.newState();
+            test.actor1(state, res1);
+            test.actor2(state, res2);
+            return Status.NORMAL;
+        } catch (NoClassDefFoundError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchFieldError e) {
+            return Status.API_MISMATCH;
+        } catch (NoSuchMethodError e) {
+            return Status.API_MISMATCH;
+        } catch (Throwable e) {
+            return Status.ERROR;
+        }
+    }
+
+    private Counter<R> run(int time) throws InterruptedException, ExecutionException {
+
+        @SuppressWarnings("unchecked")
+        final S[] poison = (S[]) new Object[0];
+
+        ControlHolder controlHolder = new ControlHolder(minStride, maxStride, shouldYield);
+
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
+
+        @SuppressWarnings("unchecked")
+        final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
+
+        @SuppressWarnings("unchecked")
+        S[] newStride = (S[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newStride[c] = test.newState();
+        }
+
+        @SuppressWarnings("unchecked")
+        R[] newResult = (R[]) new Object[minStride];
+        for (int c = 0; c < minStride; c++) {
+            newResult[c] = test.newResult();
+        }
+
+        StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 2);
+        version.set(holder);
+
+        AtomicInteger epoch = new AtomicInteger();
+
+        tasks.add(pool.submit(
+                new ActorBase<Actor2_Test<S, R>, S, R>(1, test, version, epoch, counter, controlHolder, poison) {
+                    @Override
+                    protected void work1(Actor2_Test<S, R> test, S state, R result) {
+                        test.actor1(state, result);
+                    }
+                }
+        ));
+
+        tasks.add(pool.submit(
+                new ActorBase<Actor2_Test<S, R>, S, R>(2, test, version, epoch, counter, controlHolder, poison) {
+                    @Override
+                    protected void work2(Actor2_Test<S, R> test, S state, R result) {
+                        test.actor2(state, result);
+                    }
+                }
+        ));
+
+        TimeUnit.MILLISECONDS.sleep(time);
+
+        controlHolder.isStopped = true;
+
+        if (!waitFor(tasks)) {
+            dumpFailure(test, Status.ERROR);
+        }
+
+        return counter;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/harness/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java	Thu Jul 04 12:32:04 2013 +0400
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jcstress.infra.runners;
+
+import org.openjdk.jcstress.Options;
+import org.openjdk.jcstress.infra.Status;
+import org.openjdk.jcstress.infra.collectors.TestResultCollector;
+import org.openjdk.jcstress.tests.Actor3_Test;
+import org.openjdk.jcstress.util.Counter;
+import org.openjdk.jcstress.util.Counters;
+
+import javax.xml.bind.JAXBException;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * @author Aleksey Shipilev (aleksey.shipilev@oracle.com)
+ */
+public class Actor3_Runner<S, R> extends Runner {
+    final Actor3_Test<S, R> test;
+
+    public Actor3_Runner(Options opts, Actor3_Test<S, R> test, TestResultCollector collector, ExecutorService pool) throws FileNotFoundException, JAXBException {
+        super(opts, collector, pool);
+        this.test = test;
+    }
+
+    /**
+     * Run the test.
+     * This method blocks until test is complete
+     *
+     * @throws InterruptedException
+     * @throws java.util.concurrent.ExecutionException
+     *
+     */
+    public void run() throws ExecutionException, InterruptedException {
+        testLog.println("Running " + test.getClass().getName());
+
+        Status status = checkRun();
+        if (status != Status.NORMAL) {
+            testLog.println("Test sanity check failed, skipping");
+            testLog.println();
+            dumpFailure(test, status);
+            return;
+        }
+
+        testLog.print("Iterations ");
+        for (int c = 0; c < iters; c++) {
+            testLog.print(".");
+            testLog.flush();
+            Counter<R> runResult = run(time);
+
+            dump(test, runResult);
+
+            System.gc();