Index: benchmark/ctxswitch/JavaThread.java
===================================================================
--- benchmark/ctxswitch/JavaThread.java	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/JavaThread.java	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,11 @@
+public class JavaThread {
+	public static void main(String[] args) {
+		int NoOfTimes = 5000000;
+		long start = System.nanoTime();
+		for(int i = 1; i <= NoOfTimes; i += 1) {
+			Thread.yield();
+		}
+		long end = System.nanoTime();
+		System.out.println( (end - start) / NoOfTimes);
+	}
+}
Index: benchmark/ctxswitch/cfa_cor.c
===================================================================
--- benchmark/ctxswitch/cfa_cor.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/cfa_cor.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <kernel>
+#include <thread>
+
+#include "bench.h"
+
+coroutine GreatSuspender {};
+
+void ?{}( GreatSuspender & this ) {
+	prime(this);
+}
+
+void main( GreatSuspender & this ) {
+	while( true ) {
+		suspend();
+	}
+}
+
+int main(int argc, char* argv[]) {
+	GreatSuspender s;
+
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			resume( s );
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+}
Index: benchmark/ctxswitch/cfa_thrd.c
===================================================================
--- benchmark/ctxswitch/cfa_thrd.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/cfa_thrd.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <thread>
+
+#include "bench.h"
+
+int main(int argc, char* argv[]) {
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			yield();
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+}
Index: benchmark/ctxswitch/cfa_thrd2.c
===================================================================
--- benchmark/ctxswitch/cfa_thrd2.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/cfa_thrd2.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <thread>
+
+#include "bench.h"
+
+volatile bool done = false;
+
+thread Fibre {};
+
+void main(Fibre & this) {
+	while(!done) {
+		yield();
+	}
+}
+
+int main(int argc, char* argv[]) {
+	Fibre f1;
+  	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			yield();
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+	done = true;
+	return 0;
+}
Index: benchmark/ctxswitch/goroutine.go
===================================================================
--- benchmark/ctxswitch/goroutine.go	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/goroutine.go	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,33 @@
+package main
+
+import (
+    "fmt"
+    "runtime"
+    "time"
+)
+
+//=======================================
+// time context switch
+//=======================================
+
+var shake chan bool = make( chan bool )
+
+func ContextSwitch(N int) {
+	start := time.Now()
+	for i := 1; i <= N; i += 1 {
+		runtime.Gosched()
+	}
+	end := time.Now()
+	fmt.Printf("%d\n", end.Sub(start) / time.Duration(N))
+	shake <- true   // indicate completion
+}
+
+//=======================================
+// benchmark driver
+//=======================================
+
+func main() {
+	const NoOfTimes = 10000000
+	go ContextSwitch( NoOfTimes )		// context switch
+	<- shake
+}
Index: benchmark/ctxswitch/kos_fibre.cpp
===================================================================
--- benchmark/ctxswitch/kos_fibre.cpp	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/kos_fibre.cpp	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,14 @@
+#include <libfibre/fibre.h>
+
+#include "bench.h"
+
+int main(int argc, char* argv[]) {
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			Fibre::yield();
+		},
+		result
+	)
+	printf("%llu\n", result);
+	return 0;
+}
Index: benchmark/ctxswitch/kos_fibre2.cpp
===================================================================
--- benchmark/ctxswitch/kos_fibre2.cpp	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/kos_fibre2.cpp	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,26 @@
+#include <libfibre/fibre.h>
+
+#include "bench.h"
+
+volatile bool done = false;
+
+static void f1main() {
+	while(!done) {
+		Fibre::yield();
+	}
+}
+
+int main(int argc, char* argv[]) {
+	Fibre* f1 = (new Fibre)->run(f1main);
+  	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			Fibre::yield();
+		},
+		result
+	)
+	printf("%llu\n", result);
+	done = true;
+	Fibre::yield();
+	f1->join();
+	return 0;
+}
Index: benchmark/ctxswitch/pthreads.c
===================================================================
--- benchmark/ctxswitch/pthreads.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/pthreads.c	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sched.h>
+
+#include "bench.h"
+
+int main(int argc, char* argv[]) {
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			sched_yield();
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+}
Index: benchmark/ctxswitch/upp_cor.cc
===================================================================
--- benchmark/ctxswitch/upp_cor.cc	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/upp_cor.cc	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,33 @@
+#include <cstdio>
+
+#include "bench.h"
+
+_Coroutine GreatSuspender {
+public:
+	GreatSuspender() {
+		resume();
+	}
+
+	void do_resume() {
+		resume();
+	}
+private:
+	void main() {
+		while( true ) {
+			suspend();
+		}
+	}
+};
+
+int main(int argc, char* argv[]) {
+	GreatSuspender s;
+
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			s.do_resume();
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+}
Index: benchmark/ctxswitch/upp_thrd.cc
===================================================================
--- benchmark/ctxswitch/upp_thrd.cc	(revision bf71cfdb7285490eee552b461158846f626cc52f)
+++ benchmark/ctxswitch/upp_thrd.cc	(revision bf71cfdb7285490eee552b461158846f626cc52f)
@@ -0,0 +1,14 @@
+#include <cstdio>
+
+#include "bench.h"
+
+int main(int argc, char* argv[]) {
+	BENCH(
+		for (size_t i = 0; i < n; i++) {
+			uThisTask().yield();
+		},
+		result
+	)
+
+	printf("%llu\n", result);
+}
