Index: benchmark/creation/qthreads.c
===================================================================
--- benchmark/creation/qthreads.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
+++ benchmark/creation/qthreads.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <unistd.h>
+#include <qthread.h>
+
+#include "bench.h"
+
+static aligned_t greeter( void * arg ) {
+	return 0;
+}
+
+int main( int argc, char *argv[] ) {
+	aligned_t return_value = 0;
+	int status;
+
+	status = qthread_init( 1 );
+	assert(status == QTHREAD_SUCCESS);
+
+	BENCH(
+		for ( size_t i = 0; i < n; i += 1 ) {
+			qthread_fork( greeter, NULL, &return_value );
+			qthread_readFF( NULL, &return_value );
+		}, result
+	)
+	printf( "%g\n", result );
+
+	return EXIT_SUCCESS;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc -g -O2 -Wall -I.. -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib qthreads.c -lqthread" //
+// End: //
Index: benchmark/ctxswitch/cfa_gen.cfa
===================================================================
--- benchmark/ctxswitch/cfa_gen.cfa	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
+++ benchmark/ctxswitch/cfa_gen.cfa	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
@@ -0,0 +1,27 @@
+#include "../bench.h"
+
+typedef struct {
+	void * next;
+} GreatSuspender;
+
+void comain( GreatSuspender * this ) {
+    if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next);
+    this->next = &&s1;
+	for () {
+	    return;
+	  s1: ;
+	}
+}
+
+int main(int argc, char* argv[]) {
+    GreatSuspender s = { 0 };
+
+	BENCH(
+		for ( i; n ) {
+			comain( &s );
+		},
+		result
+	)
+
+	printf("%g\n", result);
+}
Index: benchmark/ctxswitch/qthreads.c
===================================================================
--- benchmark/ctxswitch/qthreads.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
+++ benchmark/ctxswitch/qthreads.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <unistd.h>
+#include <qthread.h>
+
+#include "bench.h"
+
+int argc;
+char **argv;
+
+static aligned_t greeter( __attribute__((unused)) void * arg ) {
+	BENCH(
+		for ( size_t i = 0; i < n; i += 1 ) {
+			qthread_yield();
+		},
+		result
+	)
+	printf( "%g\n", result );
+	return 0;
+}
+
+int main( int margc, char *margv[] ) {
+	argc = margc;
+	argv = margv;
+
+	aligned_t return_value = 0;
+	int status;
+
+	status = qthread_init( 1 );
+	assert(status == QTHREAD_SUCCESS);
+
+	status = qthread_fork( greeter, NULL, &return_value );
+	assert(status == QTHREAD_SUCCESS);
+
+	int ret = qthread_readFF( NULL, &return_value );
+	assert(ret == QTHREAD_SUCCESS);
+
+	return EXIT_SUCCESS;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "gcc -g -O2 -Wall -I.. -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib qthreads.c -lqthread" //
+// End: //
Index: benchmark/ttst_lock.c
===================================================================
--- benchmark/ttst_lock.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
+++ benchmark/ttst_lock.c	(revision fe065c3c42c9e08bf80ddecebb309b0e8eed42ea)
@@ -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(
+		for (size_t i = 0; i < n; i++) {
+			do_call();
+		},
+		result
+		)
+
+		printf("%g\n", result);
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
