Index: src/libcfa/concurrency/alarm.c
===================================================================
--- src/libcfa/concurrency/alarm.c	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/alarm.c	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -15,29 +15,58 @@
 //
 
+extern "C" {
+#include <time.h>
+#include <sys/time.h>
+}
+
 #include "alarm.h"
 #include "kernel_private.h"
+#include "preemption.h"
 
-static void register_self( alarm_node_t * this ) {
-	lock( &systemProcessor->alarm_lock );
-	insert( &systemProcessor->alarms, this );
-	unlock( &systemProcessor->alarm_lock );
+//=============================================================================================
+// Clock logic
+//=============================================================================================
+
+__cfa_time_t __kernel_get_time() {
+	timespec curr;
+	clock_gettime( CLOCK_REALTIME, &curr );
+	return ((__cfa_time_t)curr.tv_sec * TIMEGRAN) + curr.tv_nsec;
 }
 
-void ?{}( alarm_node_t * this, thread_desc * thrd, cfa_time_t alarm, cfa_time_t period = 0 ) {
+void __kernel_set_timer( __cfa_time_t alarm ) {
+	itimerval val;
+	val.it_value.tv_sec = alarm / TIMEGRAN;			// seconds
+	val.it_value.tv_usec = (alarm % TIMEGRAN) / ( TIMEGRAN / 1_000_000L ); // microseconds
+	val.it_interval.tv_sec = 0;
+	val.it_interval.tv_usec = 0;
+	setitimer( ITIMER_REAL, &val, NULL );
+}
+
+//=============================================================================================
+// Alarm logic
+//=============================================================================================
+
+void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = 0, __cfa_time_t period = 0 ) {
 	this->thrd = thrd;
 	this->alarm = alarm;
 	this->period = period;
 	this->next = 0;
-
-	register_self( this );
+	this->set = false;
+	this->kernel_alarm = false;
 }
 
-void ?{}( alarm_node_t * this, processor   * proc, cfa_time_t alarm, cfa_time_t period = 0 ) {
+void ?{}( alarm_node_t * this, processor   * proc, __cfa_time_t alarm = 0, __cfa_time_t period = 0 ) {
 	this->proc = proc;
 	this->alarm = alarm;
 	this->period = period;
 	this->next = 0;
+	this->set = false;
+	this->kernel_alarm = true;
+}
 
-	register_self( this );
+void ^?{}( alarm_node_t * this ) {
+	if( this->set ) {
+		unregister_self( this );
+	}
 }
 
@@ -62,5 +91,5 @@
 }
 
-void pop( alarm_list_t * this ) {
+alarm_node_t * pop( alarm_list_t * this ) {
 	alarm_node_t * head = this->head;
 	if( head ) {
@@ -73,2 +102,46 @@
 	return head;
 }
+
+static inline void remove_at( alarm_list_t * this, alarm_node_t * n, __alarm_it_t it ) {
+	assert( it );
+	assert( (*it)->next == n );
+
+	(*it)->next = n->next;
+	if( !n-> next ) {
+		this->tail = it;
+	}
+	n->next = NULL;
+}
+
+static inline void remove( alarm_list_t * this, alarm_node_t * n ) {
+	alarm_node_t ** it = &this->head;
+	while( (*it) && (*it)->next != n ) {
+		it = &(*it)->next;
+	}
+
+	if( *it ) { remove_at( this, n, it ); }
+}
+
+void register_self( alarm_node_t * this ) {
+	disable_interrupts();
+	assert( !systemProcessor->pending_alarm );
+	lock( &systemProcessor->alarm_lock );
+	{
+		insert( &systemProcessor->alarms, this );
+		if( systemProcessor->pending_alarm ) {
+			tick_preemption();
+		}
+	}
+	unlock( &systemProcessor->alarm_lock );
+	this->set = true;
+	enable_interrupts();
+}
+
+void unregister_self( alarm_node_t * this ) {
+	disable_interrupts();
+	lock( &systemProcessor->alarm_lock );
+	remove( &systemProcessor->alarms, this );
+	unlock( &systemProcessor->alarm_lock );
+	disable_interrupts();
+	this->set = false;
+}
Index: src/libcfa/concurrency/alarm.h
===================================================================
--- src/libcfa/concurrency/alarm.h	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/alarm.h	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -18,15 +18,30 @@
 #define ALARM_H
 
+#include <stdbool.h>
+
 #include "assert"
 
-typedef unsigned long int cfa_time_t;
+typedef unsigned long int __cfa_time_t;
 
 struct thread_desc;
 struct processor;
 
+//=============================================================================================
+// Clock logic
+//=============================================================================================
+
+#define TIMEGRAN 1_000_000_000L				// nanosecond granularity, except for timeval
+
+__cfa_time_t __kernel_get_time();
+void __kernel_set_timer( __cfa_time_t alarm );
+
+//=============================================================================================
+// Alarm logic
+//=============================================================================================
+
 struct alarm_node_t {
-	cfa_time_t alarm;		// time when alarm goes off
-	cfa_time_t period;	// if > 0 => period of alarm
-	alarm_node_t * next;	// intrusive link list field
+	__cfa_time_t alarm;		// time when alarm goes off
+	__cfa_time_t period;		// if > 0 => period of alarm
+	alarm_node_t * next;		// intrusive link list field
 
 	union {
@@ -34,10 +49,14 @@
 		processor * proc;		// proc who created event
 	};
+
+	bool set		:1;		// whether or not the alarm has be registered
+	bool kernel_alarm	:1;		// true if this is not a user defined alarm
 };
 
 typedef alarm_node_t ** __alarm_it_t;
 
-void ?{}( alarm_node_t * this, thread_desc * thrd, cfa_time_t alarm, cfa_time_t period = 0 );
-void ?{}( alarm_node_t * this, processor   * proc, cfa_time_t alarm, cfa_time_t period = 0 );
+void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = 0, __cfa_time_t period = 0 );
+void ?{}( alarm_node_t * this, processor   * proc, __cfa_time_t alarm = 0, __cfa_time_t period = 0 );
+void ^?{}( alarm_node_t * this );
 
 struct alarm_list_t {
@@ -54,4 +73,7 @@
 alarm_node_t * pop( alarm_list_t * this );
 
+void register_self  ( alarm_node_t * this );
+void unregister_self( alarm_node_t * this );
+
 #endif
 
Index: src/libcfa/concurrency/kernel
===================================================================
--- src/libcfa/concurrency/kernel	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/kernel	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -28,4 +28,5 @@
 //-----------------------------------------------------------------------------
 // Locks
+bool try_lock( spinlock * );
 void lock( spinlock * );
 void unlock( spinlock * );
@@ -85,4 +86,11 @@
 
 	struct FinishAction finish;
+
+	struct alarm_node_t * preemption_alarm;
+	unsigned int preemption;
+
+	unsigned short disable_preempt_count;
+
+	bool pending_preemption;
 };
 
Index: src/libcfa/concurrency/kernel.c
===================================================================
--- src/libcfa/concurrency/kernel.c	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/kernel.c	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -36,4 +36,5 @@
 //CFA Includes
 #include "libhdr.h"
+#include "preemption.h"
 
 //Private includes
@@ -81,5 +82,4 @@
 
 void ?{}( current_stack_info_t * this ) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 1\n");
 	CtxGet( &this->ctx );
 	this->base = this->ctx.FP;
@@ -96,5 +96,4 @@
 
 void ?{}( coStack_t * this, current_stack_info_t * info) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 2\n");
 	this->size = info->size;
 	this->storage = info->storage;
@@ -107,5 +106,4 @@
 
 void ?{}( coroutine_desc * this, current_stack_info_t * info) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 3\n");
 	(&this->stack){ info };	
 	this->name = "Main Thread";
@@ -115,5 +113,4 @@
 
 void ?{}( thread_desc * this, current_stack_info_t * info) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 4\n");
 	(&this->cor){ info };
 }
@@ -122,5 +119,4 @@
 // Processor coroutine
 void ?{}(processorCtx_t * this, processor * proc) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 5\n");
 	(&this->__cor){ "Processor" };
 	this->proc = proc;
@@ -129,5 +125,4 @@
 
 void ?{}(processorCtx_t * this, processor * proc, current_stack_info_t * info) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 6\n");
 	(&this->__cor){ info };
 	this->proc = proc;
@@ -136,10 +131,8 @@
 
 void ?{}(processor * this) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 7\n");
 	this{ systemCluster };
 }
 
 void ?{}(processor * this, cluster * cltr) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 8\n");
 	this->cltr = cltr;
 	this->current_coroutine = NULL;
@@ -147,4 +140,8 @@
 	(&this->terminated){};
 	this->is_terminated = false;
+	this->preemption_alarm = NULL;
+	this->preemption = default_preemption();
+	this->disable_preempt_count = 1;		//Start with interrupts disabled
+	this->pending_preemption = false;
 
 	start( this );
@@ -157,4 +154,6 @@
 	(&this->terminated){};
 	this->is_terminated = false;
+	this->disable_preempt_count = 0;
+	this->pending_preemption = false;
 
 	this->runner = runner;
@@ -164,7 +163,7 @@
 
 void ?{}(system_proc_t * this, cluster * cltr, processorCtx_t * runner) {
-	LIB_DEBUG_PRINT_SAFE("Kernel : Ctor 9\n");
 	(&this->alarms){};
 	(&this->alarm_lock){};
+	this->pending_alarm = false;
 
 	(&this->proc){ cltr, runner };
@@ -194,27 +193,36 @@
 void main(processorCtx_t * runner) {
 	processor * this = runner->proc;
+
 	LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this);
 
-	thread_desc * readyThread = NULL;
-	for( unsigned int spin_count = 0; ! this->is_terminated; spin_count++ ) 
 	{
-		readyThread = nextThread( this->cltr );
-
-		if(readyThread) 
+		// Setup preemption data
+		preemption_scope scope = { this };
+
+		LIB_DEBUG_PRINT_SAFE("Kernel : core %p started\n", this);
+
+		thread_desc * readyThread = NULL;
+		for( unsigned int spin_count = 0; ! this->is_terminated; spin_count++ ) 
 		{
-			runThread(this, readyThread);
-
-			//Some actions need to be taken from the kernel
-			finishRunning(this);
-
-			spin_count = 0;
-		} 
-		else 
-		{
-			spin(this, &spin_count);
-		}		
-	}
-
-	LIB_DEBUG_PRINT_SAFE("Kernel : core %p unlocking thread\n", this);
+			readyThread = nextThread( this->cltr );
+
+			if(readyThread)
+			{
+				runThread(this, readyThread);
+
+				//Some actions need to be taken from the kernel
+				finishRunning(this);
+
+				spin_count = 0;
+			}
+			else
+			{
+				spin(this, &spin_count);
+			}
+		}
+
+		LIB_DEBUG_PRINT_SAFE("Kernel : core %p stopping\n", this);
+	}
+
 	signal( &this->terminated );
 	LIB_DEBUG_PRINT_SAFE("Kernel : core %p terminated\n", this);
@@ -315,10 +323,5 @@
 	LIB_DEBUG_PRINT_SAFE("Kernel : Starting core %p\n", this);
 	
-	// pthread_attr_t attributes;
-	// pthread_attr_init( &attributes );
-
 	pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
-
-	// pthread_attr_destroy( &attributes );
 
 	LIB_DEBUG_PRINT_SAFE("Kernel : core %p started\n", this);	
@@ -381,18 +384,4 @@
 	this_processor->finish.thrd_count = thrd_count;
 	suspend();
-}
-
-//=============================================================================================
-// Kernel Preemption logic
-//=============================================================================================
-
-#define __CFA_DEFAULT_PREEMPTION__ 10
-
-unsigned int default_preemption() {
-	return __CFA_DEFAULT_PREEMPTION__;
-}
-
-void kernel_start_preemption() {
-
 }
 
@@ -536,4 +525,8 @@
 }
 
+bool try_lock( spinlock * this ) {
+	return this->lock == 0 && __sync_lock_test_and_set_4( &this->lock, 1 ) == 0;
+}
+
 void lock( spinlock * this ) {
 	for ( unsigned int i = 1;; i += 1 ) {
Index: src/libcfa/concurrency/kernel_private.h
===================================================================
--- src/libcfa/concurrency/kernel_private.h	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/kernel_private.h	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -52,8 +52,30 @@
 	alarm_list_t alarms;
 	spinlock alarm_lock;
+
+	bool pending_alarm;
 };
 
 extern cluster * systemCluster;
 extern system_proc_t * systemProcessor;
+extern thread_local processor * this_processor;
+
+static inline void disable_interrupts() {
+	__attribute__((unused)) unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, 1, __ATOMIC_SEQ_CST );
+	assert( prev != (unsigned short) -1 );
+}
+
+static inline void enable_interrupts_noRF() {
+	unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, -1, __ATOMIC_SEQ_CST );
+	assert( prev != (unsigned short) 0 );
+}
+
+static inline void enable_interrupts() {
+	unsigned short prev = __atomic_fetch_add_2( &this_processor->disable_preempt_count, -1, __ATOMIC_SEQ_CST );
+	assert( prev != (unsigned short) 0 );
+	if( prev == 1 && this_processor->pending_preemption ) {
+		ScheduleInternal( this_processor->current_thread );
+		this_processor->pending_preemption = false;
+	}
+}
 
 //-----------------------------------------------------------------------------
Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/monitor	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -92,3 +92,11 @@
 uintptr_t front( condition * this );
 
+struct __acceptable_t {
+	void (*func)(void);
+	unsigned short count;
+	monitor_desc * monitors[1];
+};
+
+void __accept_internal( unsigned short count, __acceptable_t * acceptables, void (*func)(void) );
+
 #endif //MONITOR_H
Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/monitor.c	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -212,4 +212,5 @@
 	ScheduleInternal( locks, count, threads, thread_count );
 
+
 	//WE WOKE UP
 
@@ -312,4 +313,7 @@
 	ScheduleInternal( locks, count, &signallee, 1 );
 
+
+
+
 	LIB_DEBUG_PRINT_SAFE( "Back from signal block\n" );
 
@@ -330,4 +334,32 @@
 	);
 	return this->blocked.head->user_info;
+}
+
+//-----------------------------------------------------------------------------
+// Internal scheduling
+void __accept_internal( unsigned short count, __acceptable_t * acceptables, void (*func)(void) ) {
+	// thread_desc * this = this_thread();
+
+	// unsigned short count = this->current_monitor_count;
+	// unsigned int recursions[ count ];		//Save the current recursion levels to restore them later
+	// spinlock *   locks     [ count ];		//We need to pass-in an array of locks to ScheduleInternal
+
+	// lock_all( this->current_monitors, locks, count );
+
+
+
+
+
+	// // // Everything is ready to go to sleep
+	// // ScheduleInternal( locks, count, threads, thread_count );
+
+
+	// //WE WOKE UP
+
+
+	// //We are back, restore the owners and recursions
+	// lock_all( locks, count );
+	// restore_recursion( this->monitors, recursions, count );
+	// unlock_all( locks, count );
 }
 
Index: src/libcfa/concurrency/preemption.h
===================================================================
--- src/libcfa/concurrency/preemption.h	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
+++ src/libcfa/concurrency/preemption.h	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -0,0 +1,37 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// preemption.h --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Jun 5 14:20:42 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#ifndef PREEMPTION_H
+#define PREEMPTION_H
+
+#include "alarm.h"
+#include "kernel_private.h"
+
+__attribute__((weak)) unsigned int default_preemption();
+void kernel_start_preemption();
+void kernel_stop_preemption();
+void update_preemption( processor * this, __cfa_time_t duration );
+void tick_preemption();
+
+struct preemption_scope {
+	alarm_node_t alarm;
+	processor * proc;
+};
+
+void ?{}( preemption_scope * this, processor * proc );
+void ^?{}( preemption_scope * this );
+
+#endif //PREEMPTION_H
Index: src/libcfa/concurrency/signal.c
===================================================================
--- src/libcfa/concurrency/signal.c	(revision fa21ac9d92ef632e6c4267d08a93662032644c8d)
+++ src/libcfa/concurrency/signal.c	(revision c81ebf924fb91ca84affb100df945a8a6441e956)
@@ -0,0 +1,143 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// signal.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Jun 5 14:20:42 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#include "preemption.h"
+
+extern "C" {
+#include <signal.h>
+}
+
+#define __CFA_DEFAULT_PREEMPTION__ 10
+
+__attribute__((weak)) unsigned int default_preemption() {
+	return __CFA_DEFAULT_PREEMPTION__;
+}
+
+static void preempt( processor   * this );
+static void timeout( thread_desc * this );
+
+//=============================================================================================
+// Kernel Preemption logic
+//=============================================================================================
+
+void kernel_start_preemption() {
+
+}
+
+void tick_preemption() {
+	alarm_list_t * alarms = &systemProcessor->alarms;
+	__cfa_time_t currtime = __kernel_get_time();
+	while( alarms->head && alarms->head->alarm < currtime ) {
+		alarm_node_t * node = pop(alarms);
+		if( node->kernel_alarm ) {
+			preempt( node->proc );
+		}
+		else {
+			timeout( node->thrd );
+		}
+
+		if( node->period > 0 ) {
+			node->alarm += node->period;
+			insert( alarms, node );
+		}
+		else {
+			node->set = false;
+		}
+	}
+
+	if( alarms->head ) {
+		__kernel_set_timer( alarms->head->alarm - currtime );
+	}
+}
+
+void update_preemption( processor * this, __cfa_time_t duration ) {
+	//     assert( THREAD_GETMEM( disableInt ) && THREAD_GETMEM( disableIntCnt ) == 1 );
+	alarm_node_t * alarm = this->preemption_alarm;
+
+	// Alarms need to be enabled
+	if ( duration > 0 && !alarm->set ) {
+		alarm->alarm = __kernel_get_time() + duration;
+		alarm->period = duration;
+		register_self( alarm );
+	}
+	// Zero duraction but alarm is set
+	else if ( duration == 0 && alarm->set ) {
+		unregister_self( alarm );
+		alarm->alarm = 0;
+		alarm->period = 0;
+	}
+	// If alarm is different from previous, change it
+	else if ( duration > 0 && alarm->period != duration ) {
+		unregister_self( alarm );
+		alarm->alarm = __kernel_get_time() + duration;
+		alarm->period = duration;
+		register_self( alarm );
+	}
+}
+
+void ?{}( preemption_scope * this, processor * proc ) {
+	(&this->alarm){ proc };
+	this->proc = proc;
+	this->proc->preemption_alarm = &this->alarm;
+	update_preemption( this->proc, this->proc->preemption );
+}
+
+void ^?{}( preemption_scope * this ) {
+	update_preemption( this->proc, 0 );
+}
+
+//=============================================================================================
+// Kernel Signal logic
+//=============================================================================================
+
+static inline bool preemption_ready() {
+	return this_processor->disable_preempt_count == 0;
+}
+
+static inline void defer_ctxSwitch() {
+	this_processor->pending_preemption = true;
+}
+
+static inline void defer_alarm() {
+	systemProcessor->pending_alarm = true;
+}
+
+void sigHandler_ctxSwitch( __attribute__((unused)) int sig ) {
+	if( preemption_ready() ) {
+		ScheduleInternal( this_processor->current_thread );
+	}
+	else {
+		defer_ctxSwitch();
+	}
+}
+
+void sigHandler_alarm( __attribute__((unused)) int sig ) {
+	if( try_lock( &systemProcessor->alarm_lock ) ) {
+		tick_preemption();
+		unlock( &systemProcessor->alarm_lock );
+	}
+	else {
+		defer_alarm();
+	}
+}
+
+static void preempt( processor * this ) {
+	pthread_kill( this->kernel_thread, SIGUSR1 );
+}
+
+static void timeout( thread_desc * this ) {
+	//TODO : implement waking threads
+}
