From a936aa49b5171915aee6c7cecc0b84a3912fd692 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 6 Jun 2013 15:41:00 +0200 Subject: scheduler: New simple SMP scheduler implementation The new Simple SMP Scheduler allocates a processor for the processor count highest priority ready threads. The thread priority and position in the ready chain are the only information to determine the scheduling decision. Threads with an allocated processor are in the scheduled chain. After initialization the scheduled chain has exactly processor count nodes. Each processor has exactly one allocated thread after initialization. All enqueue and extract operations may exchange threads with the scheduled chain. One thread will be added and another will be removed. The scheduled and ready chain is ordered according to the thread priority order. The chain insert operations are O(count of ready threads), thus this scheduler is unsuitable for most real-time applications. The thread preempt mode will be ignored. --- cpukit/score/src/threaddispatch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/threaddispatch.c') diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c index 4856f8e67b..4cd449d55b 100644 --- a/cpukit/score/src/threaddispatch.c +++ b/cpukit/score/src/threaddispatch.c @@ -94,7 +94,10 @@ void _Thread_Dispatch( void ) _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; - #ifndef RTEMS_SMP + #if defined(RTEMS_SMP) + executing->is_executing = false; + heir->is_executing = true; + #else _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; -- cgit v1.2.3