Index: benchmark/basic/fetch_add.c
===================================================================
--- benchmark/basic/fetch_add.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/basic/fetch_add.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,26 @@
+#include <stdio.h>
+
+#include "bench.h"
+
+volatile int value;
+
+void __attribute__((noinline)) do_call() {
+	__atomic_add_fetch( &value, 1, __ATOMIC_SEQ_CST );
+	asm volatile ("");
+	__atomic_sub_fetch( &value, 1, __ATOMIC_SEQ_CST );
+}
+
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	BENCH(
+		for (size_t i = 0; i < times; i++) {
+			do_call();
+		},
+		result
+	)
+	printf( "%g\n", result );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/basic/function.c
===================================================================
--- benchmark/basic/function.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/basic/function.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+#include "bench.h"
+
+void __attribute__((noinline)) do_call() {
+	asm volatile("" ::: "memory");
+}
+
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	BENCH(
+		for (size_t i = 0; i < times; i++) {
+			do_call();
+		},
+		result
+	)
+	printf( "%g\n", result );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/basic/loop.c
===================================================================
--- benchmark/basic/loop.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/basic/loop.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+
+#include "bench.h"
+
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	BENCH(
+		for (size_t i = 0; i < times; i++) {
+			asm volatile( "" ::: "memory" );
+		},
+		result
+	)
+	printf( "%g\n", result );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/basic/tls_fetch_add.c
===================================================================
--- benchmark/basic/tls_fetch_add.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/basic/tls_fetch_add.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,31 @@
+#include <stdbool.h>
+#include <stdio.h>
+
+#include "bench.h"
+
+#define thread_local _Thread_local
+
+thread_local volatile bool value;
+
+void __attribute__((noinline)) do_call() {
+	__atomic_store_n( &value, true, __ATOMIC_RELAXED );
+	__atomic_signal_fence(__ATOMIC_ACQUIRE);
+	asm volatile ("");
+	__atomic_store_n( &value, false, __ATOMIC_RELAXED );
+	__atomic_signal_fence(__ATOMIC_RELEASE);
+}
+
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	BENCH(
+		for (size_t i = 0; i < times; i++) {
+			do_call();
+		},
+		result
+	)
+	printf( "%g\n", result );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/basic/ttst_lock.c
===================================================================
--- benchmark/basic/ttst_lock.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/basic/ttst_lock.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,50 @@
+#include <stdio.h>
+#include <stdint.h>										// uintptr_t
+
+#include "bench.h"
+
+#define CALIGN __attribute__(( aligned (CACHE_ALIGN) ))
+#define CACHE_ALIGN 128
+#define Pause() __asm__ __volatile__ ( "pause" : : : )
+
+typedef uintptr_t TYPE;									// addressable word-size
+static volatile TYPE lock __attribute__(( aligned (128) )); // Intel recommendation
+static TYPE PAD CALIGN __attribute__(( unused ));		// protect further false sharing
+
+static inline void spin_lock( volatile TYPE *lock ) {
+	enum { SPIN_START = 4, SPIN_END = 64 * 1024, };
+	unsigned int spin = SPIN_START;
+
+	for ( unsigned int i = 1;; i += 1 ) {
+	  if ( *lock == 0 && __atomic_test_and_set( lock, __ATOMIC_ACQUIRE ) == 0 ) break;
+		for ( volatile unsigned int s = 0; s < spin; s += 1 ) Pause(); // exponential spin
+		//spin += spin;									// powers of 2
+		if ( i % 64 == 0 ) spin += spin;				// slowly increase by powers of 2
+		if ( spin > SPIN_END ) spin = SPIN_START;		// prevent overflow
+	} // for
+} // spin_lock
+
+static inline void spin_unlock( volatile TYPE *lock ) {
+	__atomic_clear( lock, __ATOMIC_RELEASE );
+} // spin_unlock
+
+void __attribute__((noinline)) do_call() {
+	spin_lock( &lock );
+//	asm volatile ("");
+	spin_unlock( &lock );
+}
+
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	BENCH(
+		for (size_t i = 0; i < times; i++) {
+			do_call();
+		},
+		result
+	)
+	printf( "%g\n", result );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/JavaThread.java
===================================================================
--- benchmark/creation/JavaThread.java	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/JavaThread.java	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -26,5 +26,5 @@
 	static int x = 2;
 
-	static private final int NoOfTimes = Integer.parseInt("10000") ;
+	static private int times = Integer.parseInt("10000") ;
 
 	public static class MyThread extends Thread {
@@ -47,7 +47,10 @@
 	}
 	public static void main(String[] args) throws InterruptedException {
-		for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 
+		if ( args.length > 2 ) System.exit( 1 );
+		if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
+
+		for (int i = Integer.parseInt("5"); --i >= 0 ; ) { 
 			InnerMain();
-			Thread.sleep(2000);     // 2 seconds
+			Thread.sleep(2000);	// 2 seconds
 			x = nextRandom(x);
 		}
@@ -55,2 +58,6 @@
 	}
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/cfa_cor.cfa
===================================================================
--- benchmark/creation/cfa_cor.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/cfa_cor.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -12,12 +12,16 @@
 void main(MyCoroutine &) {}
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			MyCoroutine m;
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/cfa_thrd.cfa
===================================================================
--- benchmark/creation/cfa_thrd.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/cfa_thrd.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,12 +7,16 @@
 void main(MyThread &) {}
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			MyThread m;
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/goroutine.go
===================================================================
--- benchmark/creation/goroutine.go	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/goroutine.go	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -4,4 +4,5 @@
     "fmt"
     "time"
+    "flag"
 )
 
@@ -17,11 +18,16 @@
 
 func main() {
-	const NoOfTimes = 500000
+	times := flag.Int( "times", 500000, "loop iterations" )
+	flag.Parse()
 	start := time.Now()
-	for i := 1; i <= NoOfTimes; i += 1 {
+	for i := 1; i <= *times; i += 1 {
 		go noop()		// creation
+		<- shake		// wait for completion
 	}
 	end := time.Now()
-	fmt.Printf("%d\n", end.Sub(start) / time.Duration(NoOfTimes))
-	<- shake
+	fmt.Printf( "%d\n", end.Sub(start) / time.Duration(*times) )
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/pthreads.c
===================================================================
--- benchmark/creation/pthreads.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/pthreads.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -4,11 +4,12 @@
 #include "bench.h"
 
-static void *foo(void *arg) {
+static void * foo(void *arg) {
     return arg;
 }
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			pthread_t thread;
 			if (pthread_create(&thread, NULL, foo, NULL) < 0) {
@@ -16,5 +17,4 @@
 				return 1;
 			}
-
 			if (pthread_join( thread, NULL) < 0) {
 				perror( "failure" );
@@ -24,5 +24,8 @@
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/rust_thrd.rs
===================================================================
--- benchmark/creation/rust_thrd.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/creation/rust_thrd.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,25 @@
+use std::env;
+use std::process;
+use std::thread;
+use std::time::Instant;
+
+fn main() {
+	let mut times : u32 = 250000;
+	let args: Vec<String> = env::args().collect();
+	if args.len() > 2 { process::exit( 1 ); }
+	if args.len() == 2 { times = args[1].parse().unwrap(); }
+
+	let start = Instant::now();
+	for _ in 1..times {
+		let th = thread::spawn( move || {});
+		th.join().unwrap();
+	}
+	let duration = start.elapsed() / times;
+	println!( "{:?}", duration.as_nanos() )
+}
+
+// Local Variables: //
+// mode: c++ //
+// tab-width: 4 //
+// compile-command: "rustc -C opt-level=3 rust_thrd.rs" //
+// End: //
Index: benchmark/creation/upp_cor.cc
===================================================================
--- benchmark/creation/upp_cor.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/upp_cor.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,12 +7,16 @@
 };
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			MyCor m;
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/creation/upp_thrd.cc
===================================================================
--- benchmark/creation/upp_thrd.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/creation/upp_thrd.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,12 +7,16 @@
 };
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			MyThread m;
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/JavaThread.java
===================================================================
--- benchmark/ctxswitch/JavaThread.java	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/JavaThread.java	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -26,8 +26,8 @@
 	static int x = 2;
 
-	static private final int NoOfTimes = Integer.parseInt("1000000") ;
+	static private int times = Integer.parseInt("100000");
 
 	public static void helper() {
-		for(int i = 1; i <= NoOfTimes; i += 1) {
+		for(int i = 1; i <= times; i += 1) {
 			Thread.yield();
 		}
@@ -37,10 +37,13 @@
 		helper();
 		long end = System.nanoTime();
-		System.out.println( (end - start) / NoOfTimes );
+		System.out.println( (end - start) / times );
 	}
 	public static void main(String[] args) throws InterruptedException {
-		for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 
+		if ( args.length > 2 ) System.exit( 1 );
+		if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
+
+		for (int i = Integer.parseInt("5"); --i >= 0 ; ) {
 			InnerMain();
-			Thread.sleep(2000);     // 2 seconds
+			Thread.sleep(2000);	// 2 seconds
 			x = nextRandom(x);
 		}
@@ -48,2 +51,6 @@
 	}
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/cfa_cor.cfa
===================================================================
--- benchmark/ctxswitch/cfa_cor.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/cfa_cor.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -5,25 +5,22 @@
 
 coroutine GreatSuspender {};
-
-void ?{}( GreatSuspender & this ) {
-	prime(this);
-}
-
 void main( __attribute__((unused)) GreatSuspender & this ) {
-	while( true ) {
+	while ( true ) {
 		suspend();
 	}
 }
-
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	GreatSuspender s;
-
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			resume( s );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/cfa_cor_then.cfa
===================================================================
--- benchmark/ctxswitch/cfa_cor_then.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/cfa_cor_then.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -18,14 +18,17 @@
 }
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	GreatSuspender s;
-
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			resume( s );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/cfa_gen.cfa
===================================================================
--- benchmark/ctxswitch/cfa_gen.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/cfa_gen.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,22 +6,25 @@
 
 void comain( GreatSuspender * this ) {
-    if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);
-    this->next = &&s1;
+	if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);
+	this->next = &&s1;
 	for () {
-	    return;
+		return;
 	  s1: ;
 	}
 }
 
-int main(int argc, char* argv[]) {
-    GreatSuspender s = { 0 };
-
+int main( int argc, char * argv[] ) {
+	BENCH_START()
+	GreatSuspender s = { 0 };
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			comain( &s );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/cfa_thrd.cfa
===================================================================
--- benchmark/ctxswitch/cfa_thrd.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/cfa_thrd.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,12 +3,16 @@
 #include "bench.h"
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			yield();
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/cfa_thrd2.cfa
===================================================================
--- benchmark/ctxswitch/cfa_thrd2.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/cfa_thrd2.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -13,15 +13,18 @@
 }
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	Fibre f1;
   	BENCH(
-		for ( i; n ) {
+		for ( i; times ) {
 			yield();
 		},
 		result
 	)
+	printf( "%g\n", result );
+	done = true;
+}
 
-	printf("%g\n", result);
-	done = true;
-	return 0;
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/goroutine.go
===================================================================
--- benchmark/ctxswitch/goroutine.go	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/goroutine.go	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,6 +3,7 @@
 import (
     "fmt"
+    "time"
+    "flag"
     "runtime"
-    "time"
 )
 
@@ -28,6 +29,10 @@
 
 func main() {
-	const NoOfTimes = 10000000
-	go ContextSwitch( NoOfTimes )		// context switch
+	times := flag.Int( "times", 10000000, "loop iterations" )
+	go ContextSwitch( *times )		// context switch
 	<- shake
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/kos_fibre.cpp
===================================================================
--- benchmark/ctxswitch/kos_fibre.cpp	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/kos_fibre.cpp	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,12 +3,16 @@
 #include "bench.h"
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			Fibre::yield();
 		},
 		result
 	)
-	printf("%g\n", result);
-	return 0;
+	printf( "%g\n", result );
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/kos_fibre2.cpp
===================================================================
--- benchmark/ctxswitch/kos_fibre2.cpp	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/kos_fibre2.cpp	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -11,16 +11,20 @@
 }
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	Fibre* f1 = (new Fibre)->run(f1main);
   	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			Fibre::yield();
 		},
 		result
 	)
-	printf("%g\n", result);
+	printf( "%g\n", result );
 	done = true;
 	Fibre::yield();
 	f1->join();
-	return 0;
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/node_cor.js
===================================================================
--- benchmark/ctxswitch/node_cor.js	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/ctxswitch/node_cor.js	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,24 @@
+var times = 50000000
+var argc = process.argv.length // node, path
+if ( argc > 3 ) process.exit( 1 )
+if ( argc == 3 ) times = Number( process.argv[2] )
+
+function * coroutine() {
+	while ( true ) {
+		yield
+	}
+}
+cor = coroutine()
+
+var hrstart = process.hrtime()
+for ( var i = 0; i < times; i += 1 ) {
+	cor.next();
+}
+hrend = process.hrtime( hrstart )
+var dur = (1000000000 * hrend[0] + hrend[1]) / times
+console.log( dur )
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "node node_cor.js" //
+// End: //
Index: benchmark/ctxswitch/pthreads.c
===================================================================
--- benchmark/ctxswitch/pthreads.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/pthreads.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,12 +6,12 @@
 #include "bench.h"
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			sched_yield();
 		},
 		result
 	)
-
-	printf("%g\n", result);
+	printf( "%g\n", result );
 }
Index: benchmark/ctxswitch/python_cor.py
===================================================================
--- benchmark/ctxswitch/python_cor.py	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/ctxswitch/python_cor.py	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,26 @@
+import sys
+import time
+
+times = 50000000
+argc = len( sys.argv )
+if argc > 2:
+	sys.exit( 1 )
+if argc == 2:
+	times = int( sys.argv[1] )
+
+def GreatSuspender():
+	while True:
+		yield
+
+s = GreatSuspender()
+
+start = time.time_ns()
+for i in range( 10000000 ):
+	next( s )  # resume
+end = time.time_ns()
+print( (end - start) / times )
+
+# Local Variables: #
+# tab-width: 4 #
+# compile-command: "python3.7 python_cor.py" #
+# End: #
Index: benchmark/ctxswitch/rust_thrd.rs
===================================================================
--- benchmark/ctxswitch/rust_thrd.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/ctxswitch/rust_thrd.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,27 @@
+use std::env;
+use std::process;
+use std::thread;
+use std::time::Instant;
+
+fn main() {
+	let mut times : u32 = 50000000;
+	let args: Vec<String> = env::args().collect();
+	if args.len() > 2 { process::exit( 1 ); }
+	if args.len() == 2 { times = args[1].parse().unwrap(); }
+
+	let start = Instant::now();
+	let th = thread::spawn( move || {
+		for _ in 1..times {
+			thread::yield_now();
+		}
+	});
+	th.join().unwrap();
+	let duration = start.elapsed() / times;
+	println!( "{:?}", duration.as_nanos() )
+}
+
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "rustc -C opt-level=3 rust_thrd.rs" //
+// End: //
Index: benchmark/ctxswitch/upp_cor.cc
===================================================================
--- benchmark/ctxswitch/upp_cor.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/upp_cor.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -4,13 +4,4 @@
 
 _Coroutine GreatSuspender {
-public:
-	GreatSuspender() {
-		resume();
-	}
-
-	void do_resume() {
-		resume();
-	}
-private:
 	void main() {
 		while( true ) {
@@ -18,16 +9,22 @@
 		}
 	}
+  public:
+	void do_resume() {
+		resume();
+	}
 };
-
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	GreatSuspender s;
-
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			s.do_resume();
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/ctxswitch/upp_thrd.cc
===================================================================
--- benchmark/ctxswitch/upp_thrd.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/ctxswitch/upp_thrd.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,12 +3,16 @@
 #include "bench.h"
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			uThisTask().yield();
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/fetch_add.c
===================================================================
--- benchmark/fetch_add.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#include <stdio.h>
-
-#include "bench.h"
-
-volatile int value;
-
-void __attribute__((noinline)) do_call() {
-	__atomic_add_fetch( &value, 1, __ATOMIC_SEQ_CST );
-	asm volatile ("");
-	__atomic_sub_fetch( &value, 1, __ATOMIC_SEQ_CST );
-}
-
-int main(int argc, char* argv[]) {
-	BENCH(
-		for (size_t i = 0; i < n; i++) {
-			do_call();
-		},
-		result
-	)
-
-	printf("%g\n", result);
-}
Index: benchmark/function.c
===================================================================
--- benchmark/function.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#include <stdio.h>
-
-#include "bench.h"
-
-void __attribute__((noinline)) do_call() {
-	asm volatile("" ::: "memory");
-}
-
-int main(int argc, char* argv[]) {
-	BENCH(
-		for (size_t i = 0; i < n; i++) {
-			do_call();
-		},
-		result
-	)
-
-	printf("%g\n", result);
-}
Index: benchmark/loop.c
===================================================================
--- benchmark/loop.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <stdio.h>
-
-#include "bench.h"
-
-int main(int argc, char* argv[]) {
-	BENCH(
-		for (size_t i = 0; i < n; i++) {
-			asm volatile("" ::: "memory");
-		},
-		result
-	)
-
-	printf("%g\n", result);
-}
Index: benchmark/mutex/JavaThread.java
===================================================================
--- benchmark/mutex/JavaThread.java	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/JavaThread.java	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -26,5 +26,5 @@
 	static int x = 2;
 
-	static private final int NoOfTimes = Integer.parseInt("100000000") ;
+	static private int times = Integer.parseInt("100000000");
 
 	public synchronized void noop() {
@@ -35,5 +35,5 @@
 		// Inhibit biased locking ...
 		x = (j.hashCode() ^ System.identityHashCode(j)) | 1 ;     
-		for(int i = 1; i <= NoOfTimes; i += 1) {
+		for(int i = 1; i <= times; i += 1) {
 			x = nextRandom(x);
 			j.noop();
@@ -44,7 +44,10 @@
 		helper();
 		long end = System.nanoTime();
-		System.out.println( (end - start) / NoOfTimes );
+		System.out.println( (end - start) / times );
 	}
 	public static void main(String[] args) throws InterruptedException {
+		if ( args.length > 2 ) System.exit( 1 );
+		if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
+
 		for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 
 			InnerMain();
@@ -55,2 +58,6 @@
 	}
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/cfa1.cfa
===================================================================
--- benchmark/mutex/cfa1.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/cfa1.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,13 +7,17 @@
 void __attribute__((noinline)) call( M & mutex m ) {}
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	M m;
 	BENCH(
-		for ( i; n ) {
-			call(m);
+		for ( i; times ) {
+			call( m );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/cfa2.cfa
===================================================================
--- benchmark/mutex/cfa2.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/cfa2.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,13 +7,17 @@
 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2 ) {}
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	M m1, m2;
 	BENCH(
-		for ( i; n ) {
-			call(m1, m2);
+		for ( i; times ) {
+			call( m1, m2 );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/cfa4.cfa
===================================================================
--- benchmark/mutex/cfa4.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/cfa4.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -8,13 +8,17 @@
 void __attribute__((noinline)) call( M & mutex m1, M & mutex m2, M & mutex m3, M & mutex m4 ) {}
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	M m1, m2, m3, m4;
 	BENCH(
-		for ( i; n ) {
-			call(m1, m2, m3, m4);
+		for ( i; times ) {
+			call( m1, m2, m3, m4 );
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/goroutine.go
===================================================================
--- benchmark/mutex/goroutine.go	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/mutex/goroutine.go	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,29 @@
+package main
+
+import (
+    "fmt"
+    "time"
+    "flag"
+    "sync"
+)
+
+var mutex sync.Mutex
+
+func call() {
+     mutex.Lock();
+     mutex.Unlock();
+}
+func main() {
+	times := flag.Int( "times", 10000000, "loop iterations" )
+	flag.Parse()
+	start := time.Now()
+	for i := 1; i <= *times; i += 1 {
+		call();
+	}
+	end := time.Now()
+	fmt.Printf( "%d\n", end.Sub(start) / time.Duration(*times) )
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/pthreads.c
===================================================================
--- benchmark/mutex/pthreads.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/pthreads.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -7,16 +7,19 @@
 
 void __attribute__((noinline)) call() {
-	 pthread_mutex_lock  (&mutex);
-	 pthread_mutex_unlock(&mutex);
+	 pthread_mutex_lock( &mutex );
+	 pthread_mutex_unlock( &mutex );
 }
-
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for ( size_t i = 0; i < times; i++ ) {
 			call();
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/mutex/rust.rs
===================================================================
--- benchmark/mutex/rust.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/mutex/rust.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,29 @@
+use std::env;
+use std::process;
+use std::sync::Mutex;
+use std::time::Instant;
+
+fn call( lock : & Mutex<u32> ) {
+	let _ = lock.lock();
+}
+
+fn main() {
+	let mut times : u32 = 50000000;
+	let args: Vec<String> = env::args().collect();
+	if args.len() > 2 { process::exit( 1 ); }
+	if args.len() == 2 { times = args[1].parse().unwrap(); }
+
+	let lock = Mutex::new(0);
+
+	let start = Instant::now();
+	for _ in 1..times {
+		call( &lock );
+	}
+	let duration = start.elapsed() / times;
+	println!( "{:?}", duration.as_nanos() )
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "rustc -C opt-level=3 rust.rs" //
+// End: //
Index: benchmark/mutex/upp.cc
===================================================================
--- benchmark/mutex/upp.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/mutex/upp.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -8,13 +8,17 @@
 };
 
-int main(int argc, char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	MyMonitor m;
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for ( size_t i = 0; i < times; i++ ) {
 			m.call();
 		},
 		result
 	)
+	printf( "%g\n", result );
+}
 
-	printf("%g\n", result);
-}
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedext/cfa1.cfa
===================================================================
--- benchmark/schedext/cfa1.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedext/cfa1.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -17,12 +15,7 @@
 int  __attribute__((noinline)) wait( M & mutex a1 ) {
 	go = 1;
-	BENCH(
-		for ( i; n ) {
-			waitfor(call, a1);
-		},
-		result
-	)
-
-	printf("%g\n", result);
+	for ( i; times ) {
+		waitfor(call, a1);
+	}
 	go = 0;
 	return 0;
@@ -33,10 +26,18 @@
 void main( T & ) {
 	while(go == 0) { yield(); }
-	while(go == 1) { call(m1); }
-
+	BENCH(
+		while(go == 1) { call(m1); },
+		result
+	)
+	printf( "%g\n", result );
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
-	return wait(m1);
+	return wait( m1 );
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedext/cfa2.cfa
===================================================================
--- benchmark/schedext/cfa2.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedext/cfa2.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -17,12 +15,7 @@
 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) {
 	go = 1;
-	BENCH(
-		for ( i; n ) {
-			waitfor(call, a1, a2);
-		},
-		result
-	)
-
-	printf("%g\n", result);
+	for ( i; times ) {
+		waitfor(call, a1, a2);
+	}
 	go = 0;
 	return 0;
@@ -33,10 +26,18 @@
 void main( T & ) {
 	while(go == 0) { yield(); }
-	while(go == 1) { call(m1, m2); }
-
+	BENCH(
+		while(go == 1) { call(m1, m2); },
+		result
+	)
+	printf( "%g\n", result );
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
-	return wait(m1, m2);
+	return wait( m1, m2 );
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedext/cfa4.cfa
===================================================================
--- benchmark/schedext/cfa4.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedext/cfa4.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -17,12 +15,7 @@
 int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
 	go = 1;
-	BENCH(
-		for ( i; n ) {
-			waitfor(call, a1, a2, a3, a4);
-		},
-		result
-	)
-
-	printf("%g\n", result);
+	for ( i; times ) {
+		waitfor( call, a1, a2, a3, a4 );
+	}
 	go = 0;
 	return 0;
@@ -33,10 +26,18 @@
 void main( T & ) {
 	while(go == 0) { yield(); }
-	while(go == 1) { call(m1, m2, m3, m4); }
-
+	BENCH(
+		while(go == 1) { call(m1, m2, m3, m4); },
+		result
+	)
+	printf( "%g\n", result );
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
-	return wait(m1, m2, m3, m4);
+	return wait( m1, m2, m3, m4 );
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedext/upp.cc
===================================================================
--- benchmark/schedext/upp.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedext/upp.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,6 +3,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -13,12 +11,7 @@
 	int __attribute__((noinline)) wait() {
 		go = 1;
-		BENCH(
-			for (size_t i = 0; i < n; i++) {
-				_Accept(call);
-			},
-			result
-		)
-
-		printf("%g\n", result);
+		for (size_t i = 0; i < times; i++) {
+			_Accept(call);
+		}
 		go = 0;
 		return 0;
@@ -31,13 +24,19 @@
 	void main() {
 		while(go == 0) { yield(); }
-		while(go == 1) { m.call(); }
-
+		BENCH(
+			while(go == 1) { m.call(); },
+			result
+		)
+		printf( "%g\n", result );
 	}
 };
 
-int main(int margc, char* margv[]) {
-	argc = margc;
-	argv = margv;
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
 	return m.wait();
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/JavaThread.java
===================================================================
--- benchmark/schedint/JavaThread.java	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/JavaThread.java	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -49,8 +49,8 @@
 	static int x = 2;
 
-	static private final int NoOfTimes = Integer.parseInt("1000000") ;
+	static private int times = Integer.parseInt("1000000");
 
 	public static void helper( Monitor m ) throws InterruptedException {
-		for(int i = 1; i <= NoOfTimes; i += 1) {
+		for(int i = 1; i <= times; i += 1) {
 			m.wait();		// relase monitor lock
 			m.next = true;
@@ -72,7 +72,10 @@
 		Monitor.go = false;
 		s.join();
-		System.out.println( (end - start) / NoOfTimes);
+		System.out.println( (end - start) / times);
 	}
 	public static void main(String[] args) throws InterruptedException {
+		if ( args.length > 2 ) System.exit( 1 );
+		if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
+
 		for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 
 			InnerMain();
@@ -83,2 +86,6 @@
 	}
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/cfa1.cfa
===================================================================
--- benchmark/schedint/cfa1.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/cfa1.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -26,6 +24,5 @@
 		result
 	)
-
-	printf("%g\n", result);
+	printf( "%g\n", result );
 	go = 0;
 	return 0;
@@ -40,6 +37,11 @@
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
 	return wait(m1);
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/cfa2.cfa
===================================================================
--- benchmark/schedint/cfa2.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/cfa2.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -26,6 +24,5 @@
 		result
 	)
-
-	printf("%g\n", result);
+	printf( "%g\n", result );
 	go = 0;
 	return 0;
@@ -40,6 +37,11 @@
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
 	return wait(m1, m2);
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/cfa4.cfa
===================================================================
--- benchmark/schedint/cfa4.cfa	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/cfa4.cfa	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -6,6 +6,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -26,6 +24,5 @@
 		result
 	)
-
-	printf("%g\n", result);
+	printf( "%g\n", result );
 	go = 0;
 	return 0;
@@ -40,6 +37,11 @@
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
 	return wait(m1, m2, m3, m4);
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/pthreads.c
===================================================================
--- benchmark/schedint/pthreads.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/pthreads.c	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -4,6 +4,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -21,11 +19,10 @@
 	go = 1;
 	BENCH(
-		for (size_t i = 0; i < n; i++) {
+		for (size_t i = 0; i < times; i++) {
 			pthread_cond_wait(&c, &m);
 		},
 		result
 	)
-
-	printf("%g\n", result);
+	printf( "%g\n", result );
 	go = 0;
 	pthread_mutex_unlock(&m);
@@ -39,5 +36,6 @@
 }
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	pthread_t thread;
 	if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
@@ -50,4 +48,7 @@
 		return 1;
 	}
-	return 0;
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/schedint/rust.rs
===================================================================
--- benchmark/schedint/rust.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
+++ benchmark/schedint/rust.rs	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -0,0 +1,45 @@
+use std::env;
+use std::process;
+use std::thread;
+use std::sync::{Arc, Mutex, Condvar};
+use std::time::Instant;
+
+fn main() {
+	let mut times : u32 = 500000;
+	let args: Vec<String> = env::args().collect();
+	if args.len() > 2 { process::exit( 1 ); }
+	if args.len() == 2 { times = args[1].parse().unwrap(); }
+
+	let m = Arc::new(Mutex::new(0));
+	let c = Arc::new(Condvar::new());
+
+	let m2 = Arc::clone(&m);
+	let c2 = Arc::clone(&c);
+
+	let th = thread::spawn( move || {
+		while *m2.lock().unwrap() == 0 {
+			thread::yield_now();
+		}
+		let start = Instant::now();
+		while *m2.lock().unwrap() == 1 {
+			c2.notify_one();
+		}
+		let duration = start.elapsed() / times;
+		println!( "{:?}", duration.as_nanos() );
+	});
+ 	{
+		let mut sc = m.lock().unwrap();
+		*sc = 1;
+		for _ in 1..times {
+			sc = c.wait(sc).unwrap();
+		}
+		*sc = 0;
+	}
+	th.join().unwrap();
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "rustc -C opt-level=3 rust.rs" //
+// End: //
+
Index: benchmark/schedint/upp.cc
===================================================================
--- benchmark/schedint/upp.cc	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ benchmark/schedint/upp.cc	(revision b4107c815918e9d1300f3381d29c2a863abf7de8)
@@ -3,6 +3,4 @@
 #include "bench.h"
 
-int argc;
-char** argv;
 volatile int go = 0;
 
@@ -22,6 +20,5 @@
 			result
 		)
-
-		printf("%g\n", result);
+		printf( "%g\n", result );
 		go = 0;
 		return 0;
@@ -39,6 +36,11 @@
 };
 
-int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
+int main( int argc, char * argv[] ) {
+	BENCH_START()
 	T t;
 	return m.wait();
 }
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: benchmark/tls-fetch_add.c
===================================================================
--- benchmark/tls-fetch_add.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#include <stdbool.h>
-#include <stdio.h>
-
-#include "bench.h"
-
-#define thread_local _Thread_local
-
-thread_local volatile bool value;
-
-void __attribute__((noinline)) do_call() {
-	__atomic_store_n( &value, true, __ATOMIC_RELAXED );
-	__atomic_signal_fence(__ATOMIC_ACQUIRE);
-	asm volatile ("");
-	__atomic_store_n( &value, false, __ATOMIC_RELAXED );
-	__atomic_signal_fence(__ATOMIC_RELEASE);
-}
-
-int main(int argc, char* argv[]) {
-	BENCH(
-		for (size_t i = 0; i < n; i++) {
-			do_call();
-		},
-		result
-	)
-
-	printf("%g\n", result);
-}
Index: benchmark/ttst_lock.c
===================================================================
--- benchmark/ttst_lock.c	(revision 846c026c176ce0693b7dc5e3cb2cc03da4e5ccaa)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#include <stdio.h>
-#include <stdint.h>										// uintptr_t
-
-#include "bench.h"
-
-#define CALIGN __attribute__(( aligned (CACHE_ALIGN) ))
-#define CACHE_ALIGN 128
-#define Pause() __asm__ __volatile__ ( "pause" : : : )
-
-typedef uintptr_t TYPE;									// addressable word-size
-static volatile TYPE lock __attribute__(( aligned (128) )); // Intel recommendation
-static TYPE PAD CALIGN __attribute__(( unused ));		// protect further false sharing
-
-static inline void spin_lock( volatile TYPE *lock ) {
-	enum { SPIN_START = 4, SPIN_END = 64 * 1024, };
-	unsigned int spin = SPIN_START;
-
-	for ( unsigned int i = 1;; i += 1 ) {
-	  if ( *lock == 0 && __atomic_test_and_set( lock, __ATOMIC_ACQUIRE ) == 0 ) break;
-		for ( volatile unsigned int s = 0; s < spin; s += 1 ) Pause(); // exponential spin
-		//spin += spin;									// powers of 2
-		if ( i % 64 == 0 ) spin += spin;				// slowly increase by powers of 2
-		if ( spin > SPIN_END ) spin = SPIN_START;		// prevent overflow
-	} // for
-} // spin_lock
-
-static inline void spin_unlock( volatile TYPE *lock ) {
-	__atomic_clear( lock, __ATOMIC_RELEASE );
-} // spin_unlock
-
-void __attribute__((noinline)) do_call() {
-	spin_lock( &lock );
-//	asm volatile ("");
-	spin_unlock( &lock );
-}
-
-int main(int argc, char* argv[]) {
-	BENCH(
-		for (size_t i = 0; i < n; i++) {
-			do_call();
-		},
-		result
-		)
-
-		printf("%g\n", result);
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// End: //
