Index: libcfa/src/concurrency/invoke.h
===================================================================
--- libcfa/src/concurrency/invoke.h	(revision 524627e64a50bddd1e59585514345b5458ae7f47)
+++ libcfa/src/concurrency/invoke.h	(revision 05035b3c08ad398eb43dc62a5a74dc315751d253)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 18:19:13 2019
-// Update Count     : 40
+// Last Modified On : Thu Nov 28 22:34:07 2019
+// Update Count     : 41
 //
 
@@ -51,4 +51,5 @@
 
 			struct {
+				void * stack;
 				volatile unsigned short disable_count;
 				volatile bool enabled;
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 524627e64a50bddd1e59585514345b5458ae7f47)
+++ libcfa/src/concurrency/kernel.cfa	(revision 05035b3c08ad398eb43dc62a5a74dc315751d253)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 21 16:46:59 2019
-// Update Count     : 27
+// Last Modified On : Fri Nov 29 17:59:16 2019
+// Update Count     : 35
 //
 
@@ -26,4 +26,5 @@
 #include <signal.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
 }
 
@@ -133,5 +134,5 @@
 	NULL,
 	NULL,
-	{ 1, false, false },
+	{ NULL, 1, false, false },
 	6u //this should be seeded better but due to a bug calling rdtsc doesn't work
 };
@@ -233,4 +234,5 @@
 
 	pthread_join( kernel_thread, NULL );
+	free( this.stack );
 }
 
@@ -445,5 +447,29 @@
 	__cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
 
-	pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
+	pthread_attr_t attr;
+	int ret;
+	ret = pthread_attr_init( &attr );					// initialize attribute
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_init failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+
+	size_t stacksize;
+	ret = pthread_attr_getstacksize( &attr, &stacksize ); // default stack size, normally defined by shell limit
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_getstacksize failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+	assert( stacksize >= PTHREAD_STACK_MIN );
+
+	this->stack = malloc( stacksize );
+	ret = pthread_attr_setstack( &attr, this->stack, stacksize ); 
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_setstack failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+
+	ret = pthread_create( &this->kernel_thread, &attr, CtxInvokeProcessor, (void *)this );
+	if ( ret ) {
+		abort( "%s : internal error, pthread_create failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+//	pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
 
 	__cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
Index: libcfa/src/concurrency/kernel.hfa
===================================================================
--- libcfa/src/concurrency/kernel.hfa	(revision 524627e64a50bddd1e59585514345b5458ae7f47)
+++ libcfa/src/concurrency/kernel.hfa	(revision 05035b3c08ad398eb43dc62a5a74dc315751d253)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 22 11:39:17 2019
-// Update Count     : 16
+// Last Modified On : Thu Nov 28 21:24:12 2019
+// Update Count     : 17
 //
 
@@ -135,4 +135,7 @@
 	semaphore terminated;
 
+	// pthread Stack
+	void * stack;
+
 	// Link lists fields
 	struct __dbg_node_proc {
Index: libcfa/src/concurrency/preemption.cfa
===================================================================
--- libcfa/src/concurrency/preemption.cfa	(revision 524627e64a50bddd1e59585514345b5458ae7f47)
+++ libcfa/src/concurrency/preemption.cfa	(revision 05035b3c08ad398eb43dc62a5a74dc315751d253)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun  5 17:35:49 2018
-// Update Count     : 37
+// Last Modified On : Sat Nov 30 08:02:56 2019
+// Update Count     : 39
 //
 
@@ -24,4 +24,5 @@
 #include <string.h>
 #include <unistd.h>
+#include <limits.h>										// PTHREAD_STACK_MIN
 }
 
@@ -81,14 +82,14 @@
 // Get next expired node
 static inline alarm_node_t * get_expired( alarm_list_t * alarms, Time currtime ) {
-	if( !alarms->head ) return NULL;                          // If no alarms return null
-	if( alarms->head->alarm >= currtime ) return NULL;        // If alarms head not expired return null
-	return pop(alarms);                                       // Otherwise just pop head
+	if( !alarms->head ) return 0p;						// If no alarms return null
+	if( alarms->head->alarm >= currtime ) return 0p;	// If alarms head not expired return null
+	return pop(alarms);									// Otherwise just pop head
 }
 
 // Tick one frame of the Discrete Event Simulation for alarms
 static void tick_preemption() {
-	alarm_node_t * node = NULL;                     // Used in the while loop but cannot be declared in the while condition
-	alarm_list_t * alarms = &event_kernel->alarms;  // Local copy for ease of reading
-	Time currtime = __kernel_get_time();			// Check current time once so we everything "happens at once"
+	alarm_node_t * node = 0p;							// Used in the while loop but cannot be declared in the while condition
+	alarm_list_t * alarms = &event_kernel->alarms;		// Local copy for ease of reading
+	Time currtime = __kernel_get_time();				// Check current time once so everything "happens at once"
 
 	//Loop throught every thing expired
@@ -243,5 +244,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_UNBLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_UNBLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -254,5 +255,5 @@
 	sigaddset( &mask, sig );
 
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -301,9 +302,32 @@
 
 	// Setup proper signal handlers
-	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART );         // CtxSwitch handler
+	__cfaabi_sigaction( SIGUSR1, sigHandler_ctxSwitch, SA_SIGINFO | SA_RESTART ); // CtxSwitch handler
 
 	signal_block( SIGALRM );
 
-	pthread_create( &alarm_thread, NULL, alarm_loop, NULL );
+	pthread_attr_t attr;
+	int ret;
+	ret = pthread_attr_init( &attr );					// initialize attribute
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_init failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+
+	size_t stacksize;
+	ret = pthread_attr_getstacksize( &attr, &stacksize ); // default stack size, normally defined by shell limit
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_getstacksize failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+	assert( stacksize >= PTHREAD_STACK_MIN );
+
+	kernelTLS.preemption_state.stack = malloc( stacksize );
+	ret = pthread_attr_setstack( &attr, kernelTLS.preemption_state.stack, stacksize ); 
+	if ( ret ) {
+		abort( "%s : internal error, pthread_attr_setstack failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
+
+	ret = pthread_create( &alarm_thread, &attr, alarm_loop, 0p );
+	if ( ret ) {
+		abort( "%s : internal error, pthread_create failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) );
+	} // if
 }
 
@@ -316,5 +340,5 @@
 	sigset_t mask;
 	sigfillset( &mask );
-	sigprocmask( SIG_BLOCK, &mask, NULL );
+	sigprocmask( SIG_BLOCK, &mask, 0p );
 
 	// Notify the alarm thread of the shutdown
@@ -323,5 +347,7 @@
 
 	// Wait for the preemption thread to finish
-	pthread_join( alarm_thread, NULL );
+
+	pthread_join( alarm_thread, 0p );
+	free( kernelTLS.preemption_state.stack );
 
 	// Preemption is now fully stopped
@@ -380,5 +406,5 @@
 	static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" );
 	#endif
-	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), 0p ) == -1 ) {
 		abort( "internal error, sigprocmask" );
 	}
@@ -399,5 +425,5 @@
 	sigset_t mask;
 	sigfillset(&mask);
-	if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) {
+	if ( pthread_sigmask( SIG_BLOCK, &mask, 0p ) == -1 ) {
 	    abort( "internal error, pthread_sigmask" );
 	}
@@ -420,5 +446,5 @@
 					{__cfaabi_dbg_print_buffer_decl( " KERNEL: Spurious wakeup %d.\n", err );}
 					continue;
-       			case EINVAL :
+				case EINVAL :
 				 	abort( "Timeout was invalid." );
 				default:
@@ -453,5 +479,5 @@
 EXIT:
 	__cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" );
-	return NULL;
+	return 0p;
 }
 
@@ -466,5 +492,5 @@
 	sigset_t oldset;
 	int ret;
-	ret = pthread_sigmask(0, NULL, &oldset);
+	ret = pthread_sigmask(0, 0p, &oldset);
 	if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); }
 
