Index: src/examples/thread.c
===================================================================
--- src/examples/thread.c	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/examples/thread.c	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -17,9 +17,16 @@
 struct MyThread {
 	thread_h t;
-	int value;
+	unsigned id;
+	unsigned count;
 };
 
-void ?{}( MyThread * this, int value ) {
-	this->value = value;
+void ?{}( MyThread * this ) {
+	this->id = 0;
+	this->count = 10;
+}
+
+void ?{}( MyThread * this, unsigned id, unsigned count ) {
+	this->id = id;
+	this->count = count;
 }
 
@@ -28,5 +35,11 @@
 void main(MyThread* this) {
 	printf("Main called with %p\n", this);
-	printf("Thread value is %d\n", this->value);
+	printf("Thread %d : Suspending %d times\n", this->id, this->count);
+
+	for(int i = 0; i < this->count; i++) {
+		printf("Thread %d : Suspend No. %d\n", this->id, i + 1);
+		printf("Back to %p\n", &this->t.c);
+		suspend();
+	}
 }
 
@@ -39,28 +52,17 @@
 }
 
-void ?{}( MyThread * this ) {
-	this->value = 1;
-	printf("MyThread created\n");
-	printf("Address %p\n", this);
-	printf("handle %p\n", get_thread(this));
-	printf("main %p\n", main);
-	printf("get_t %p\n", get_thread);
-	printf("invoke %p\n", CtxInvokeThread);
-}
-
 int main() {
 
-	printf("Main is %p\n", this_coroutine());
+	thread(MyThread) thread1;
+	thread(MyThread) thread2;
 
-	printf("Creating thread\n");
+	thread2.handle.id = 1;
 
-	thread(MyThread) thread1;
-
-	printf("Main is %p\n", this_coroutine());
-
-	printf("First thread created\n");
+	printf("\n\nMain is %p\n", this_coroutine());
 
 	kernel_run();
 
+	printf("Kernel terminated correctly\n");
+
 	return 0;
 }
Index: src/libcfa/concurrency/coroutines
===================================================================
--- src/libcfa/concurrency/coroutines	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/coroutines	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -29,4 +29,6 @@
       coroutine * get_coroutine(T * this);
 };
+
+#define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this);
 
 //-----------------------------------------------------------------------------
Index: src/libcfa/concurrency/invoke.c
===================================================================
--- src/libcfa/concurrency/invoke.c	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/invoke.c	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -14,4 +14,5 @@
 
 extern void __suspend_no_inline__F___1(void);
+extern void __scheduler_remove__F_P9sthread_h__1(struct thread_h*);
 
 void CtxInvokeCoroutine(
@@ -20,5 +21,5 @@
       void *this
 ) {
-      LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
+      // LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
 
       struct coroutine* cor = get_coroutine( this );
@@ -42,13 +43,16 @@
       void *this
 ) {
-      LIB_DEBUG_PRINTF("Invoke Thread : Received %p (main %p, get_t %p)\n", this, main, get_thread);
+      // LIB_DEBUG_PRINTF("Invoke Thread : Received %p (main %p, get_t %p)\n", this, main, get_thread);
 
       __suspend_no_inline__F___1();
 
-      struct coroutine* cor = &get_thread( this )->c;
+      struct thread_h* thrd = get_thread( this );
+      struct coroutine* cor = &thrd->c;
       cor->state = Active;
 
-      LIB_DEBUG_PRINTF("Invoke Thread : invoking main %p (args %p)\n", main, this);
+      // LIB_DEBUG_PRINTF("Invoke Thread : invoking main %p (args %p)\n", main, this);
       main( this );
+
+      __scheduler_remove__F_P9sthread_h__1(thrd);
 
       //Final suspend, should never return
@@ -64,5 +68,5 @@
       void (*invoke)(void *)
 ) {
-      LIB_DEBUG_PRINTF("StartCoroutine : Passing in %p (main %p) to invoke (%p) from start (%p)\n", this, main, invoke, CtxStart);
+      // LIB_DEBUG_PRINTF("StartCoroutine : Passing in %p (main %p) to invoke (%p) from start (%p)\n", this, main, invoke, CtxStart);
 
       struct coStack_t* stack = &get_coroutine( this )->stack;
Index: src/libcfa/concurrency/kernel
===================================================================
--- src/libcfa/concurrency/kernel	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/kernel	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -18,6 +18,19 @@
 #define KERNEL_H
 
-extern struct thread_h * the_thread;
+#include <stdbool.h>
 
+struct processor {
+	struct proc_coroutine * cor;
+	unsigned int thread_index;
+	unsigned int thread_count;
+	struct thread_h * threads[10];
+	bool terminated;
+};
+
+void ?{}(processor * this);
+void ^?{}(processor * this);
+
+void scheduler_add( struct thread_h * thrd );
+void scheduler_remove( struct thread_h * thrd );
 void kernel_run( void );
 
Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/kernel.c	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -19,5 +19,5 @@
 
 //C Includes
-#include <stdbool.h>
+#include <stddef.h>
 
 //CFA Includes
@@ -29,25 +29,143 @@
 #include "invoke.h"
 
-thread_h * the_thread = 0;
+processor systemProcessorStorage = {};
+processor * systemProcessor = &systemProcessorStorage;
+
+void ?{}(processor * this) {
+	this->cor = NULL;
+	this->thread_index = 0;
+	this->thread_count = 10;
+	this->terminated = false;
+
+	for(int i = 0; i < 10; i++) {
+		this->threads[i] = NULL;
+	}
+
+	LIB_DEBUG_PRINTF("Processor : ctor for core %p (core spots %d)\n", this, this->thread_count);
+}
+
+void ^?{}(processor * this) {
+
+}
+
+//-----------------------------------------------------------------------------
+// Processor coroutine
+struct proc_coroutine {
+	processor * proc;
+	coroutine c;
+};
+
+void ?{}(coroutine * this, processor * proc) {
+	this{};
+}
+
+DECL_COROUTINE(proc_coroutine)
+
+void ?{}(proc_coroutine * this, processor * proc) {
+	(&this->c){proc};
+	this->proc = proc;
+	proc->cor = this;
+}
+
+void ^?{}(proc_coroutine * this) {
+	^(&this->c){};
+}
+
+void CtxInvokeProcessor(processor * proc) {
+	proc_coroutine proc_cor_storage = {proc};
+	resume( &proc_cor_storage );
+}
+
+//-----------------------------------------------------------------------------
+// Processor running routines
+void main(proc_coroutine * cor);
+thread_h * nextThread(processor * this);
+void runThread(processor * this, thread_h * dst);
+void spin(processor * this, unsigned int * spin_count);
+
+void main(proc_coroutine * cor) {
+	processor * this;
+	this = cor->proc;
+
+	thread_h * readyThread = NULL;
+	for( unsigned int spin_count = 0; ! this->terminated; spin_count++ ) {
+		
+		readyThread = nextThread(this);
+
+		if(readyThread) {
+			runThread(this, readyThread);
+			spin_count = 0;
+		} else {
+			spin(this, &spin_count);
+		}		
+	}
+
+	LIB_DEBUG_PRINTF("Kernel : core %p terminated\n", this);
+}
+
+thread_h * nextThread(processor * this) {
+	for(int i = 0; i < this->thread_count; i++) {
+		this->thread_index = (this->thread_index + 1) % this->thread_count;	
+		
+		thread_h * thrd = this->threads[this->thread_index];
+		if(thrd) return thrd;
+	}
+
+	return NULL;
+}
+
+void runThread(processor * this, thread_h * dst) {
+	coroutine * proc_ctx = get_coroutine(this->cor);
+	coroutine * thrd_ctx = get_coroutine(dst);
+	thrd_ctx->last = proc_ctx;
+
+	// context switch to specified coroutine
+	// Which is now the current_coroutine
+	LIB_DEBUG_PRINTF("Kernel : switching to ctx %p (from %p, current %p)\n", thrd_ctx, proc_ctx, current_coroutine);
+	current_coroutine = thrd_ctx;
+	CtxSwitch( proc_ctx->stack.context, thrd_ctx->stack.context );
+	current_coroutine = proc_ctx;
+	LIB_DEBUG_PRINTF("Kernel : returned from ctx %p (to %p, current %p)\n", thrd_ctx, proc_ctx, current_coroutine);
+
+	// when CtxSwitch returns we are back in the processor coroutine
+}
+
+void spin(processor * this, unsigned int * spin_count) {
+	(*spin_count)++;
+}
+
+//-----------------------------------------------------------------------------
+// Kernel runner (Temporary)
+
+void scheduler_add( struct thread_h * thrd ) {
+	LIB_DEBUG_PRINTF("Kernel : scheduling %p on core %p (%d spots)\n", thrd, systemProcessor, systemProcessor->thread_count);
+	for(int i = 0; i < systemProcessor->thread_count; i++) {
+		if(systemProcessor->threads[i] == NULL) {
+			systemProcessor->threads[i] = thrd;
+			return;
+		}
+	}
+	assert(false);
+}
+
+void scheduler_remove( struct thread_h * thrd ) {
+	LIB_DEBUG_PRINTF("Kernel : unscheduling %p from core %p\n", thrd, systemProcessor);
+	for(int i = 0; i < systemProcessor->thread_count; i++) {
+		if(systemProcessor->threads[i] == thrd) {
+			systemProcessor->threads[i] = NULL;
+			break;
+		}
+	}
+	for(int i = 0; i < systemProcessor->thread_count; i++) {
+		if(systemProcessor->threads[i] != NULL) {
+			return;
+		}
+	}
+	LIB_DEBUG_PRINTF("Kernel : terminating core %p\n\n\n", systemProcessor);	
+	systemProcessor->terminated = true;
+}
 
 void kernel_run( void ) {
-	
-	bool done = true;
-	coroutine* processor_cor = this_coroutine();
-	LIB_DEBUG_PRINTF("Kernel : processor cor is %p\n", processor_cor);
-
-	do {
-		thread_h * dst = the_thread;
-
-		LIB_DEBUG_PRINTF("Kernel : picked thread %p\n", dst);
-
-		// set new coroutine that task is executing
-		current_coroutine = &dst->c;
-
-		// context switch to specified coroutine
-		LIB_DEBUG_PRINTF("Kernel : switching to ctx %p (from %p)\n", current_coroutine, processor_cor);
-		CtxSwitch( processor_cor->stack.context, current_coroutine->stack.context );
-		// when CtxSwitch returns we are back in the processor coroutine
-	} while( ! done );
+	CtxInvokeProcessor(systemProcessor);
 }
 
Index: src/libcfa/concurrency/threads
===================================================================
--- src/libcfa/concurrency/threads	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/threads	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -39,4 +39,8 @@
 }
 
+static inline coroutine* get_coroutine(thread_h* this) {
+	return &this->c;
+}
+
 //-----------------------------------------------------------------------------
 // Ctors and dtors
Index: src/libcfa/concurrency/threads.c
===================================================================
--- src/libcfa/concurrency/threads.c	(revision 7fbe45024a0e66932c8f18b15610b0c295b507fa)
+++ src/libcfa/concurrency/threads.c	(revision c84e80aa83b9917829e6f5f923487d8ece403218)
@@ -78,5 +78,5 @@
 	current_coroutine = thrd_c;
 
-	LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", handle, thrd_c, thrd_h);
+	// LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", handle, thrd_c, thrd_h);
 
 	create_stack(&thrd_c->stack, thrd_c->stack.size);
@@ -84,5 +84,5 @@
 	CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context );
 
-	the_thread = thrd_h;
+	scheduler_add(thrd_h);
 }
 
