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/threadinitialize.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpukit/score/src/threadinitialize.c') diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index fb22578c3d..4c40ae87b8 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -180,6 +180,12 @@ bool _Thread_Initialize( the_thread->Start.isr_level = isr_level; +#if defined(RTEMS_SMP) + the_thread->is_scheduled = false; + the_thread->is_executing = false; + the_thread->cpu = NULL; +#endif + the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; the_thread->resource_count = 0; -- cgit v1.2.3