Changeset 2e0a2a0 in rtems-docs


Ignore:
Timestamp:
Feb 2, 2017, 9:49:56 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3e005fe
Parents:
b033e39
Message:

c-user: Add SMP implementation details section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c-user/symmetric_multiprocessing_services.rst

    rb033e39 r2e0a2a0  
    334334priority four.
    335335
    336 Thread Dispatch Details
    337 -----------------------
    338 
    339 This section gives background information to developers interested in the
    340 interrupt latencies introduced by thread dispatching.  A thread dispatch
    341 consists of all work which must be done to stop the currently executing thread
    342 on a processor and hand over this processor to an heir thread.
    343 
    344 In SMP systems, scheduling decisions on one processor must be propagated
    345 to other processors through inter-processor interrupts.  A thread dispatch
    346 which must be carried out on another processor does not happen instantaneously.
    347 Thus, several thread dispatch requests might be in the air and it is possible
    348 that some of them may be out of date before the corresponding processor has
    349 time to deal with them.  The thread dispatch mechanism uses three per-processor
    350 variables,
    351 
    352 - the executing thread,
    353 
    354 - the heir thread, and
    355 
    356 - a boolean flag indicating if a thread dispatch is necessary or not.
    357 
    358 Updates of the heir thread are done via a normal store operation.  The thread
    359 dispatch necessary indicator of another processor is set as a side-effect of an
    360 inter-processor interrupt.  So, this change notification works without the use
    361 of locks.  The thread context is protected by a TTAS lock embedded in the
    362 context to ensure that it is used on at most one processor at a time.
    363 Normally, only thread-specific or per-processor locks are used during a thread
    364 dispatch.  This implementation turned out to be quite efficient and no lock
    365 contention was observed in the testsuite.  The heavy-weight thread dispatch
    366 sequence is only entered in case the thread dispatch indicator is set.
    367 
    368 The context-switch is performed with interrupts enabled.  During the transition
    369 from the executing to the heir thread neither the stack of the executing nor
    370 the heir thread must be used during interrupt processing.  For this purpose a
    371 temporary per-processor stack is set up which may be used by the interrupt
    372 prologue before the stack is switched to the interrupt stack.
    373 
    374336Application Issues
    375337==================
     
    563525Therefore, self-contained synchronization objects are now available for RTEMS.
    564526
     527Implementation Details
     528======================
     529
     530Thread Dispatch Details
     531-----------------------
     532
     533This section gives background information to developers interested in the
     534interrupt latencies introduced by thread dispatching.  A thread dispatch
     535consists of all work which must be done to stop the currently executing thread
     536on a processor and hand over this processor to an heir thread.
     537
     538In SMP systems, scheduling decisions on one processor must be propagated
     539to other processors through inter-processor interrupts.  A thread dispatch
     540which must be carried out on another processor does not happen instantaneously.
     541Thus, several thread dispatch requests might be in the air and it is possible
     542that some of them may be out of date before the corresponding processor has
     543time to deal with them.  The thread dispatch mechanism uses three per-processor
     544variables,
     545
     546- the executing thread,
     547
     548- the heir thread, and
     549
     550- a boolean flag indicating if a thread dispatch is necessary or not.
     551
     552Updates of the heir thread are done via a normal store operation.  The thread
     553dispatch necessary indicator of another processor is set as a side-effect of an
     554inter-processor interrupt.  So, this change notification works without the use
     555of locks.  The thread context is protected by a TTAS lock embedded in the
     556context to ensure that it is used on at most one processor at a time.
     557Normally, only thread-specific or per-processor locks are used during a thread
     558dispatch.  This implementation turned out to be quite efficient and no lock
     559contention was observed in the testsuite.  The heavy-weight thread dispatch
     560sequence is only entered in case the thread dispatch indicator is set.
     561
     562The context-switch is performed with interrupts enabled.  During the transition
     563from the executing to the heir thread neither the stack of the executing nor
     564the heir thread must be used during interrupt processing.  For this purpose a
     565temporary per-processor stack is set up which may be used by the interrupt
     566prologue before the stack is switched to the interrupt stack.
     567
    565568Directives
    566569==========
Note: See TracChangeset for help on using the changeset viewer.