source: rtems/cpukit/score/src/threadstart.c @ 25f5730f

4.115
Last change on this file since 25f5730f was c5831a3f, checked in by Sebastian Huber <sebastian.huber@…>, on 04/09/14 at 13:07:54

score: Add clustered/partitioned scheduling

Clustered/partitioned scheduling helps to control the worst-case
latencies in the system. The goal is to reduce the amount of shared
state in the system and thus prevention of lock contention. Modern
multi-processor systems tend to have several layers of data and
instruction caches. With clustered/partitioned scheduling it is
possible to honour the cache topology of a system and thus avoid
expensive cache synchronization traffic.

We have clustered scheduling in case the set of processors of a system
is partitioned into non-empty pairwise-disjoint subsets. These subsets
are called clusters. Clusters with a cardinality of one are partitions.
Each cluster is owned by exactly one scheduler instance.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initializes Thread and Executes it
5 *
6 * @ingroup ScoreThread
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/threadimpl.h>
23#include <rtems/score/isrlevel.h>
24#include <rtems/score/schedulerimpl.h>
25#include <rtems/score/userextimpl.h>
26
27bool _Thread_Start(
28  Thread_Control            *the_thread,
29  Thread_Start_types         the_prototype,
30  void                      *entry_point,
31  void                      *pointer_argument,
32  Thread_Entry_numeric_type  numeric_argument,
33  Per_CPU_Control           *cpu
34)
35{
36  if ( _States_Is_dormant( the_thread->current_state ) ) {
37
38    the_thread->Start.entry_point      = (Thread_Entry) entry_point;
39
40    the_thread->Start.prototype        = the_prototype;
41    the_thread->Start.pointer_argument = pointer_argument;
42    the_thread->Start.numeric_argument = numeric_argument;
43
44    _Thread_Load_environment( the_thread );
45
46    if ( cpu == NULL ) {
47      _Thread_Ready( the_thread );
48    } else {
49      const Scheduler_Control *scheduler = _Scheduler_Get_by_CPU( cpu );
50
51      if ( scheduler != NULL ) {
52        the_thread->current_state = STATES_READY;
53        _Scheduler_Start_idle( scheduler, the_thread, cpu );
54      }
55    }
56
57    _User_extensions_Thread_start( the_thread );
58
59    return true;
60  }
61
62  return false;
63}
Note: See TracBrowser for help on using the repository browser.