summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqops.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Mark parameters as intentionally unusedSebastian Huber2024-03-221-0/+2
| | | | | | | | The parameters are unused due to API constraints. The functions are used through function pointers. Alternative implementations may use the parameters. Update #4862.
* score: Assert scheduler index validitySebastian Huber2023-07-281-0/+1
| | | | Update #4844.
* Update company nameSebastian Huber2023-05-201-1/+1
| | | | | The embedded brains GmbH & Co. KG is the legal successor of embedded brains GmbH.
* score: Make SMP only code explicitSebastian Huber2022-06-231-2/+14
| | | | | | | Conditional expressions with inline functions are not optimized away if optimization is disabled. Avoid such expressions to prevent dead branches. It helps also during code review to immediately see if a loop is used or not.
* cpukit/: Scripted embedded brains header file clean upJoel Sherrill2022-03-101-6/+0
| | | | Updates #4625.
* score/src/[t-z]*.c: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* score: Add Thread_queue_Deadlock_statusSebastian Huber2021-10-011-2/+2
| | | | | | Replace the boolen return value with the new enum Thread_queue_Deadlock_status. This improves the code readability. Improve documentation. Shorten function names.
* score: Remove _Thread_queue_Do_nothing_extract()Sebastian Huber2021-09-301-14/+2
| | | | | | | This function was unused. It was a relict of the thread queue rework done during the SMP support development. In an early stage, the extract operation was called with a NULL thread queue. However, this is no longer the case. The extract operation is only called if we have a non-NULL thread queue.
* score: Document thread queue operationsSebastian Huber2021-09-031-2/+2
|
* score: Replace priority prepend it with an enumSebastian Huber2021-08-121-9/+9
| | | | | | | | Use the new Priority_Group_order enum instead of a boolean to indicated if a priority should be inserted as the first or last node into its priority group. This makes the code more expressive. It is also a bit more efficient since a branch in _Scheduler_Node_set_priority() is avoided and a simple bitwise or operation can be used.
* score: Fix warning in thread queue opsChris Johns2021-02-161-3/+3
|
* score: Make FIFO thread queue ops publicSebastian Huber2021-02-061-8/+9
| | | | Update #4230.
* score: Constify Thread_queue_First_operationSebastian Huber2021-02-061-6/+6
| | | | Update #4230.
* score: Canonicalize Doxygen @file commentsSebastian Huber2020-12-021-0/+11
| | | | | | Use common phrases for the file brief descriptions. Update #3706.
* Canonicalize config.h includeSebastian Huber2020-04-161-2/+2
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* score: Fix plain priority thread queues (SMP)Sebastian Huber2019-02-071-0/+8
| | | | We must add/remove the priority queue to the FIFO of priority queues.
* score: Delete Thread_Scheduler_control::own_nodeSebastian Huber2016-11-021-5/+5
| | | | Update #2556.
* score: Add _Thread_Scheduler_remove_wait_node()Sebastian Huber2016-11-021-2/+4
| | | | Update #2556.
* score: Add _Thread_Scheduler_add_wait_node()Sebastian Huber2016-11-021-4/+1
| | | | Update #2556.
* score: Add _Scheduler_Node_get_scheduler()Sebastian Huber2016-11-021-1/+1
| | | | Update #2556.
* score: Fix warningSebastian Huber2016-09-271-0/+2
|
* score: Scheduler node awareness for thread queuesSebastian Huber2016-09-211-254/+713
| | | | | | | | Maintain the priority of a thread for each scheduler instance via the thread queue enqueue, extract, priority actions and surrender operations. This replaces the primitive priority boosting. Update #2556.
* score: Rework thread priority managementSebastian Huber2016-09-211-186/+661
| | | | | | | | | | | | | | | | | | | | | | | | | Add priority nodes which contribute to the overall thread priority. The actual priority of a thread is now an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes. A thread changes its priority now immediately, e.g. priority changes are not deferred until the thread releases its last resource. Replace the _Thread_Change_priority() function with * _Thread_Priority_perform_actions(), * _Thread_Priority_add(), * _Thread_Priority_remove(), * _Thread_Priority_change(), and * _Thread_Priority_update(). Update #2412. Update #2556.
* score: Introduce _Thread_Get_priority()Sebastian Huber2016-09-081-2/+2
| | | | Avoid direct access to thread internal data fields.
* score: Move thread wait node to scheduler nodeSebastian Huber2016-09-081-20/+53
| | | | Update #2556.
* score: Optimize thread queue enqueueSebastian Huber2016-09-081-17/+32
| | | | Optimize the enqueue to empty thread queue case.
* score: Introduce thread queue surrender operationSebastian Huber2016-08-111-8/+71
| | | | | | This is an optimization for _Thread_queue_Surrender(). It helps to encapsulate the priority boosting in the priority inheritance thread queue operations.
* score: Add debug support to red-black treesSebastian Huber2016-08-081-0/+1
| | | | This helps to detect double insert and extract errors.
* score: Fix and simplify thread wait locksSebastian Huber2016-08-031-50/+16
| | | | | | | | | | There was a subtile race condition in _Thread_queue_Do_extract_locked(). It must first update the thread wait flags and then restore the default thread wait state. In the previous implementation this could lead under rare timing conditions to an ineffective _Thread_Wait_tranquilize() resulting to a corrupt system state. Update #2556.
* score: Turn thread lock into thread wait lockSebastian Huber2016-07-271-17/+46
| | | | | | | | | The _Thread_Lock_acquire() function had a potentially infinite run-time due to the lack of fairness at atomic operations level. Update #2412. Update #2556. Update #2765.
* score: Priority inherit thread queue operationsSebastian Huber2016-07-271-3/+75
| | | | | | | | | Move the priority change due to priority interitance to the thread queue enqueue operation to simplify the locking on SMP configurations. Update #2412. Update #2556. Update #2765.
* score: Simplify _Thread_queue_Boost_priority()Sebastian Huber2016-07-271-11/+15
| | | | | | | | | | Raise the priority under thread queue lock protection and omit the superfluous thread queue priority change, since the thread is extracted anyway. The unblock operation will pick up the new priority. Update #2412. Update #2556. Update #2765.
* score: Add debug support to chainsSebastian Huber2016-07-221-0/+1
| | | | | | | This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
* score: Use _RBTree_Insert_inline()Sebastian Huber2016-05-201-6/+22
| | | | | | Use _RBTree_Insert_inline() for priority thread queues. Update #2556.
* score: Fix warningSebastian Huber2015-11-041-1/+1
| | | | Close #2454.
* score: Implement priority boostingSebastian Huber2015-09-041-0/+22
|
* score: Implement SMP-specific priority queueSebastian Huber2015-09-041-9/+61
|
* score: Optimize thread queue first operationSebastian Huber2015-09-021-5/+10
| | | | | In case the thread queue heads exist, then the queue is not empty. See _Thread_queue_First_locked().
* rbtree: Add _RBTree_Minimum(), _RBTree_Maximum()Sebastian Huber2015-08-311-1/+1
|
* score: Introduce Thread_queue_HeadsSebastian Huber2015-07-231-23/+124
| | | | | | | | | | | | | Move the storage for the thread queue heads to the threads. Each thread provides a set of thread queue heads allocated from a dedicated memory pool. In case a thread blocks on a queue, then it lends its heads to the queue. In case the thread unblocks, then it takes a free set of threads from the queue. Since a thread can block on at most one queue this works. This mechanism is used in FreeBSD. The motivation for this change is to reduce the memory demands of the synchronization objects. On a 32-bit uni-processor configuration the Thread_queue_Control size is now 8 bytes, compared to 64 bytes in RTEMS 4.10 (other changes reduced the size as well).
* score: Introduce Thread_queue_QueueSebastian Huber2015-07-231-29/+29
| | | | | | Separate the thread queue heads and lock from the operations. This enables the support for light weight objects which only support one queuing discipline.
* score: New thread queue implementationSebastian Huber2015-05-191-23/+0
| | | | | | | | | Use thread wait flags for synchronization. The enqueue operation is now part of the initial critical section. This is the key change and enables fine grained locking on SMP for objects using a thread queue like semaphores and message queues. Update #2273.
* score: More thread queue operationsSebastian Huber2015-05-191-8/+135
| | | | | | | | | Move thread queue discipline specific operations into Thread_queue_Operations. Use a separate node in the thread control block for the thread queue to make it independent of the scheduler data structures. Update #2273.
* score: Add Thread_queue_OperationsSebastian Huber2015-05-191-0/+56
Replace the Thread_Priority_control with more general Thread_queue_Operations which will be used for generic priority change, timeout, signal and wait queue operations in the future. Update #2273.