nuttx/sched
Gregory Nutt 3e13ed2400 Within the OS, when a thread obtains a semaphore count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is enabled. If a count is available, then sem_wait() calls sem_addholder(), otherwise it waited for the semaphore and called sem_addholder() when it eventually received the count.
This caused a problem when the thread calling sem_wait() was very low priority.  When it received the count, there may be higher priority threads "hogging" the CPU that prevent the lower priority task from running and, as a result, the sem_addholder() may be delayed indefinitely.

The fix was to have sem_post() call sem_addholder() just before restarting the thread waiting for the semaphore count.

This problem was noted by Benix Vincent who also suggested the solution.
2016-10-26 07:23:15 -06:00
..
clock sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:32:11 -06:00
environ sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
errno Remove some empty file section section header comments 2016-02-17 18:05:03 -06:00
group Explicitly initialize the group tg_exitsem with sem_init(). The existing logic worked because the correct initialization value is all zero, but it is better to initialize the semaphore explicitly. Noted by Jouko Holopainen. 2016-08-10 07:38:07 -06:00
init Move include/nuttx/lib.h to include/nuttx/lib/lib.h 2016-07-21 14:05:44 -06:00
irq vector table should have dimension NR_IRQS, not NR_IRQS+1 2016-09-22 07:56:12 -06:00
module Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
mqueue Correct a comment 2016-09-15 13:10:42 -06:00
paging Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
pthread sched/pthread and task: When a pthread is started, there is a small bit of logic that will run on the thread of execution of the new pthread. In the case where the new pthread has a lower priority than the parent thread, then this could cause both the parent thread and the new pthread to be blocked at the priority of the lower priority pthread (assuming that CONFIG_PRIORITY_INHERITANCE is not selected). 2016-10-01 11:38:22 -06:00
sched sched/: Move fields related to parent/child task relationship out of TCB into group structure. 2016-09-06 08:28:31 -06:00
semaphore Within the OS, when a thread obtains a semaphore count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is enabled. If a count is available, then sem_wait() calls sem_addholder(), otherwise it waited for the semaphore and called sem_addholder() when it eventually received the count. 2016-10-26 07:23:15 -06:00
signal Explicitly initialize the group tg_exitsem with sem_init(). The existing logic worked because the correct initialization value is all zero, but it is better to initialize the semaphore explicitly. Noted by Jouko Holopainen. 2016-08-10 07:38:07 -06:00
task sched/pthread and task: When a pthread is started, there is a small bit of logic that will run on the thread of execution of the new pthread. In the case where the new pthread has a lower priority than the parent thread, then this could cause both the parent thread and the new pthread to be blocked at the priority of the lower priority pthread (assuming that CONFIG_PRIORITY_INHERITANCE is not selected). 2016-10-01 11:38:22 -06:00
timer sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:32:11 -06:00
wdog sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
wqueue sched/: Review and correct some stylistic inconsistencies 2016-08-07 08:25:30 -06:00
.gitignore
Kconfig Trivial typo fix 2016-08-20 13:23:41 -06:00
Makefile TLS: Simplify 2016-03-11 07:17:32 -06:00