summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/statesimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Delete STATES_WAITING_ON_THREAD_QUEUESebastian Huber2015-05-191-24/+2
| | | | | | Avoid the usage of the current thread state in _Thread_queue_Extract_with_return_code() since thread queues should not know anything about thread states.
* score: Fix POSIX thread joinSebastian Huber2015-04-231-1/+3
| | | | | | | | | | | | A thread join is twofold. There is one thread that exists and an arbitrary number of threads that wait for the thread exit (one-to-many relation). The exiting thread may want to wait for a thread that wants to join its exit (STATES_WAITING_FOR_JOIN_AT_EXIT in _POSIX_Thread_Exit()). On the other side we need a thread queue for all the threads that wait for the exit of one particular thread (STATES_WAITING_FOR_JOIN in pthread_join()). Update #2035.
* score: Use _Thread_Clear_state() for _Thread_ReadySebastian Huber2015-04-081-0/+3
|
* score: Simplify _Thread_Change_priority()Sebastian Huber2014-05-151-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | The function to change a thread priority was too complex. Simplify it with a new scheduler operation. This increases the average case performance due to the simplified logic. The interrupt disabled critical section is a bit prolonged since now the extract, update and enqueue steps are executed atomically. This should however not impact the worst-case interrupt latency since at least for the Deterministic Priority Scheduler this sequence can be carried out with a wee bit of instructions and no loops. Add _Scheduler_Change_priority() to replace the sequence of - _Thread_Set_transient(), - _Scheduler_Extract(), - _Scheduler_Enqueue(), and - _Scheduler_Enqueue_first(). Delete STATES_TRANSIENT, _States_Is_transient() and _Thread_Set_transient() since this state is now superfluous. With this change it is possible to get rid of the SCHEDULER_SMP_NODE_IN_THE_AIR state. This considerably simplifies the implementation of the new SMP locking protocols.
* score: Add STATES_RESTARTINGSebastian Huber2014-05-141-0/+2
| | | | Use separate state for thread restart.
* score: TypoSebastian Huber2014-05-141-1/+1
|
* score: Implement forced thread migrationSebastian Huber2014-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of task migration in RTEMS has some implications with respect to the interrupt latency. It is crucial to preserve the system invariant that a task can execute on at most one processor in the system at a time. This is accomplished with a boolean indicator in the task context. The processor architecture specific low-level task context switch code will mark that a task context is no longer executing and waits that the heir context stopped execution before it restores the heir context and resumes execution of the heir task. So there is one point in time in which a processor is without a task. This is essential to avoid cyclic dependencies in case multiple tasks migrate at once. Otherwise some supervising entity is necessary to prevent life-locks. Such a global supervisor would lead to scalability problems so this approach is not used. Currently the thread dispatch is performed with interrupts disabled. So in case the heir task is currently executing on another processor then this prolongs the time of disabled interrupts since one processor has to wait for another processor to make progress. It is difficult to avoid this issue with the interrupt latency since interrupts normally store the context of the interrupted task on its stack. In case a task is marked as not executing we must not use its task stack to store such an interrupt context. We cannot use the heir stack before it stopped execution on another processor. So if we enable interrupts during this transition we have to provide an alternative task independent stack for this time frame. This issue needs further investigation.
* score: Thread life cycle re-implementationSebastian Huber2014-03-311-0/+4
| | | | | | | | | | | | | | | | | | | The thread deletion is now supported on SMP. This change fixes the following PRs: PR1814: SMP race condition between stack free and dispatch PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract() The POSIX cleanup handler are now called in the right context (should be called in the context of the terminating thread). http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html Add a user extension the reflects a thread termination event. This is used to reclaim the Newlib reentrancy structure (may use file operations), the POSIX cleanup handlers and the POSIX key destructors.
* score: Delete unused STATES_ALL_SETSebastian Huber2014-03-241-2/+0
|
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: New state STATES_WAITING_FOR_BSD_WAKEUPSebastian Huber2013-10-311-0/+3
| | | | This state is necessery to implement the SLEEP(9) FreeBSD kernel API.
* score: Create states implementation headerSebastian Huber2013-07-261-0/+477
Move implementation specific parts of states.h and states.inl into new header file statesimpl.h. The states.h contains now only the application visible API.