summaryrefslogtreecommitdiffstats
path: root/cpukit/posix (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-05-15score: Simplify _Thread_Change_priority()Sebastian Huber2-10/+3
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.
2014-05-06posix: Fix POSIX keys initializationSebastian Huber1-5/+5
Always initialize the freechain. This prevents a NULL pointer access in case no initial key value pairs are defined.
2014-04-15score: Add clustered/partitioned schedulingSebastian Huber2-3/+5
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.
2014-04-15score: Simplify thread control initializationSebastian Huber1-22/+3
The thread control block contains fields that point to application configuration dependent memory areas, like the scheduler information, the API control blocks, the user extension context table, the RTEMS notepads and the Newlib re-entrancy support. Account for these areas in the configuration and avoid extra workspace allocations for these areas. This helps also to avoid heap fragementation and reduces the per thread memory due to a reduced heap allocation overhead.
2014-04-07score: Lazy key value pair allocationSebastian Huber1-9/+13
2014-04-07score: Delete _Thread_Ticks_per_timesliceSebastian Huber2-4/+9
Use the Configuration instead.
2014-04-04score: Add scheduler control to scheduler opsSebastian Huber5-14/+23
Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
2014-04-03pthreadimpl.h: Conditionalize thread affinity copyingJoel Sherrill1-1/+1
2014-04-03pthreadcreate.c: Fix bug where attr used instead of the_attrJoel Sherrill1-14/+13
2014-04-03pthread.c: Conditionalize thread affinity initializationJoel Sherrill1-1/+1
2014-04-03posix: Move affinity from thread to scheduler.Jennifer Averett4-21/+28
2014-04-03posix: Modified pthread init to use cpuset default.Jennifer Averett1-12/+8
2014-03-31score: Delete CORE_mutex_Control::lockSebastian Huber1-6/+1
The holder field is enough to determine if a mutex is locked or not. This leads also to better error status codes in case a rtems_semaphore_release() is done for a mutex without having the ownership.
2014-03-31score: PR2152: Use allocator mutex for objectsSebastian Huber27-121/+106
Use allocator mutex for objects allocate/free. This prevents that the thread dispatch latency depends on the workspace/heap fragmentation.
2014-03-31score: Relax Giant lock usage for API mutexesSebastian Huber1-1/+1
It is no longer necessary to protect the workspace allocations with the Giant lock due to the thread life cycle re-implementation.
2014-03-31score: Thread life cycle re-implementationSebastian Huber4-70/+62
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.
2014-03-31score: Fix thread restart extensions contextSebastian Huber1-1/+10
Run the thread restart extensions in the context of the restarted thread. Run them with thread dispatching enabled.
2014-03-31posix: Use thread action for signalsSebastian Huber7-23/+28
2014-03-24posix: Prevent pthread_setspecific from returning EAGAIN.Christian Mauderer1-24/+35
The man-page for pthread_setspecific does not define the EAGAIN return value. Further without this patch it was not possible to set keys that have been already set a new value. Add test for setting a new value to a already set key.
2014-03-21score: Unify pthread and gxx_wrapper once and move to score.Christian Mauderer1-35/+2
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns262-262/+262
2014-03-19posix: Use interal mutex for once implementationSebastian Huber5-139/+25
Enable pthread_once() for all configurations. The pthread_once() function is one means to initialize POSIX keys. Another use case is the C++ support.
2014-03-14score: Add SMP lock profiling supportSebastian Huber1-1/+1
2014-03-11posix: Fix NULL pointer access in pthread_create()Sebastian Huber1-2/+2
2014-03-11score: Add local context to SMP lock APISebastian Huber5-19/+19
Add a local context structure to the SMP lock API for acquire and release pairs. This context can be used to store the ISR level and profiling information. It may be later used to enable more sophisticated lock algorithms, e.g. MCS locks. There is only one lock that cannot be used with a local context. This is the per-CPU lock since here we would have to transfer the local context through a context switch which is very complicated.
2014-03-11sapi: Use one SMP lock for all chainsSebastian Huber2-15/+10
This partially reverts commit 1215fd4d9426a59d568560e9a485628560363133. In order to support profiling of SMP locks and provide a future compatible SMP locks API it is necessary to add an SMP lock destroy function. Since the commit above adds an SMP lock to each chain control we would have to add a rtems_chain_destroy() function as well. This complicates the chain usage dramatically. Thus revert the patch above. A global SMP lock for all chains is used to implement the protected chain operations. Advantages: * The SAPI chain API is now identical on SMP and non-SMP configurations. * The size of the chain control is reduced and is then equal to the Score chains. * The protected chain operations work correctly on SMP. Disadvantage: * Applications using many different chains and the protected operations may notice lock contention. The chain control size drop is a huge benefit (SAPI chain controls are 66% larger than the Score chain controls). The only disadvantage is not really a problem since these applications can use specific interrupt locks and unprotected chain operations to avoid this issue.
2014-03-11posix: RegenerateSebastian Huber1-0/+2
2014-03-10posix: Fix NULL pointer access in pthread_create()Sebastian Huber1-1/+1
2014-03-07POSIX keys now enabled in all configurations.Joel Sherrill8-78/+46
Formerly POSIX keys were only enabled when POSIX threads were enabled. Because they are a truly safe alternative to per-task variables in an SMP system, they are being enabled in all configurations.
2014-03-07Remove trailing whitespace in previous patchesJennifer Averett7-23/+23
2014-03-07posix: Add pthread_getattr_np().Jennifer Averett2-0/+58
This is a useful POSIX thread API helper which is found in `GNU/Linux and *BSD.
2014-03-07posix: Add dynamic pthread get and set affinity.Jennifer Averett3-1/+139
This patch adds the following methods: + pthread_get_affinity_np + pthread_set_affinity_np
2014-03-07posix: Add pthread_attr_t methods to get/set affinity.Jennifer Averett3-0/+108
This patch adds the following methods: + pthread_attr_get_affinity_np + pthread_attr_set_affinity_np
2014-03-07posix: Add support method to compare two pthread attribute structures.Jennifer Averett2-0/+95
2014-03-07posix: Add POSIX thread affinity attribute support.Jennifer Averett4-16/+129
With the addition of pthread affinity information in pthread_attr_t, the existing code for pthread_attr_t had to be adjusted.
2014-02-19posix: Set pthread attribute values in detach and setschedparm methods.Jennifer Averett2-0/+4
2014-02-03posix/*.c: Remove use of register keywordJoel Sherrill13-26/+26
2014-01-09posix: fix race condition between pthread_create and capture engineTill Strauman1-0/+5
Reproducable crashes occur when using pthreads and the capture engine at the same time. 'pthread_create()' is the culprit. It creates a SCORE thread and then calls Thread_Start( ) without disabling thread-dispatching.
2013-12-10alarm.c: Use _Assert() not assert()Joel Sherrill1-1/+1
2013-12-09alarm.c: Per comment add debug code for kill() failingJoel Sherrill1-4/+17
This is highly unlikely and would indicate a serious bug in the system or corruption. But it is better to be cautious.
2013-12-09pthread.c: Use UINT32_MAX rather than constant valueJoel Sherrill1-1/+1
2013-12-09condwaitsupp.c: Return EPERM if waiting and mutex is not lockedJoel Sherrill1-4/+8
This error check was commented out because it is not in the POSIX specification. However, the GNU/Linux manual page does document that EPERM is to be returned in this situation.
2013-12-09psignalimpl.h: Remove dead commentJoel Sherrill1-3/+1
2013-12-09pthread.c: Remove XXX and use SIGNAL_ constantsJoel Sherrill1-5/+3
2013-12-09posix/config.h: Comment clean upJoel Sherrill1-10/+102
2013-12-09signalcatch.c: Remove junk commentJoel Sherrill1-1/+1
2013-12-09timerimpl.h: Comment clean upJoel Sherrill1-36/+22
2013-12-09semaphoreimpl.h: Comment clean upJoel Sherrill1-79/+38
2013-12-09mqueueimpl.h: Comment clean upJoel Sherrill1-176/+91
2013-12-09condimpl.h: Comment clean upJoel Sherrill1-98/+35