summaryrefslogtreecommitdiffstats
path: root/cpukit/posix (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Simplify _Thread_Change_priority()Sebastian Huber2014-05-152-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.
* posix: Fix POSIX keys initializationSebastian Huber2014-05-061-5/+5
| | | | | Always initialize the freechain. This prevents a NULL pointer access in case no initial key value pairs are defined.
* score: Add clustered/partitioned schedulingSebastian Huber2014-04-152-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.
* score: Simplify thread control initializationSebastian Huber2014-04-151-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.
* score: Lazy key value pair allocationSebastian Huber2014-04-071-9/+13
|
* score: Delete _Thread_Ticks_per_timesliceSebastian Huber2014-04-072-4/+9
| | | | Use the Configuration instead.
* score: Add scheduler control to scheduler opsSebastian Huber2014-04-045-14/+23
| | | | | Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
* pthreadimpl.h: Conditionalize thread affinity copyingJoel Sherrill2014-04-031-1/+1
|
* pthreadcreate.c: Fix bug where attr used instead of the_attrJoel Sherrill2014-04-031-14/+13
|
* pthread.c: Conditionalize thread affinity initializationJoel Sherrill2014-04-031-1/+1
|
* posix: Move affinity from thread to scheduler.Jennifer Averett2014-04-034-21/+28
|
* posix: Modified pthread init to use cpuset default.Jennifer Averett2014-04-031-12/+8
|
* score: Delete CORE_mutex_Control::lockSebastian Huber2014-03-311-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.
* score: PR2152: Use allocator mutex for objectsSebastian Huber2014-03-3127-121/+106
| | | | | Use allocator mutex for objects allocate/free. This prevents that the thread dispatch latency depends on the workspace/heap fragmentation.
* score: Relax Giant lock usage for API mutexesSebastian Huber2014-03-311-1/+1
| | | | | It is no longer necessary to protect the workspace allocations with the Giant lock due to the thread life cycle re-implementation.
* score: Thread life cycle re-implementationSebastian Huber2014-03-314-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.
* score: Fix thread restart extensions contextSebastian Huber2014-03-311-1/+10
| | | | | Run the thread restart extensions in the context of the restarted thread. Run them with thread dispatching enabled.
* posix: Use thread action for signalsSebastian Huber2014-03-317-23/+28
|
* posix: Prevent pthread_setspecific from returning EAGAIN.Christian Mauderer2014-03-241-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.
* score: Unify pthread and gxx_wrapper once and move to score.Christian Mauderer2014-03-211-35/+2
|
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-21262-262/+262
|
* posix: Use interal mutex for once implementationSebastian Huber2014-03-195-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.
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-1/+1
|
* posix: Fix NULL pointer access in pthread_create()Sebastian Huber2014-03-111-2/+2
|
* score: Add local context to SMP lock APISebastian Huber2014-03-115-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.
* sapi: Use one SMP lock for all chainsSebastian Huber2014-03-112-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.
* posix: RegenerateSebastian Huber2014-03-111-0/+2
|
* posix: Fix NULL pointer access in pthread_create()Sebastian Huber2014-03-101-1/+1
|
* POSIX keys now enabled in all configurations.Joel Sherrill2014-03-078-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.
* Remove trailing whitespace in previous patchesJennifer Averett2014-03-077-23/+23
|
* posix: Add pthread_getattr_np().Jennifer Averett2014-03-072-0/+58
| | | | | This is a useful POSIX thread API helper which is found in `GNU/Linux and *BSD.
* posix: Add dynamic pthread get and set affinity.Jennifer Averett2014-03-073-1/+139
| | | | | | | This patch adds the following methods: + pthread_get_affinity_np + pthread_set_affinity_np
* posix: Add pthread_attr_t methods to get/set affinity.Jennifer Averett2014-03-073-0/+108
| | | | | | | This patch adds the following methods: + pthread_attr_get_affinity_np + pthread_attr_set_affinity_np
* posix: Add support method to compare two pthread attribute structures.Jennifer Averett2014-03-072-0/+95
|
* posix: Add POSIX thread affinity attribute support.Jennifer Averett2014-03-074-16/+129
| | | | | With the addition of pthread affinity information in pthread_attr_t, the existing code for pthread_attr_t had to be adjusted.
* posix: Set pthread attribute values in detach and setschedparm methods.Jennifer Averett2014-02-192-0/+4
|
* posix/*.c: Remove use of register keywordJoel Sherrill2014-02-0313-26/+26
|
* posix: fix race condition between pthread_create and capture engineTill Strauman2014-01-091-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.
* alarm.c: Use _Assert() not assert()Joel Sherrill2013-12-101-1/+1
|
* alarm.c: Per comment add debug code for kill() failingJoel Sherrill2013-12-091-4/+17
| | | | | This is highly unlikely and would indicate a serious bug in the system or corruption. But it is better to be cautious.
* pthread.c: Use UINT32_MAX rather than constant valueJoel Sherrill2013-12-091-1/+1
|
* condwaitsupp.c: Return EPERM if waiting and mutex is not lockedJoel Sherrill2013-12-091-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.
* psignalimpl.h: Remove dead commentJoel Sherrill2013-12-091-3/+1
|
* pthread.c: Remove XXX and use SIGNAL_ constantsJoel Sherrill2013-12-091-5/+3
|
* posix/config.h: Comment clean upJoel Sherrill2013-12-091-10/+102
|
* signalcatch.c: Remove junk commentJoel Sherrill2013-12-091-1/+1
|
* timerimpl.h: Comment clean upJoel Sherrill2013-12-091-36/+22
|
* semaphoreimpl.h: Comment clean upJoel Sherrill2013-12-091-79/+38
|
* mqueueimpl.h: Comment clean upJoel Sherrill2013-12-091-176/+91
|
* condimpl.h: Comment clean upJoel Sherrill2013-12-091-98/+35
|