summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/posix/pthreadimpl.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-09-19Do not use RTEMS_INLINE_ROUTINESebastian Huber1-2/+2
Directly use "static inline" which is available in C99 and later. This brings the RTEMS implementation closer to standard C. Close #3935.
2022-02-28cpukit/include/rtems/posix/*.h: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2021-11-15score: Introduce CPU budget operationsSebastian Huber1-11/+4
This patch set replaces the CPU budget algorithm enumeration with a set of CPU budget operations which implement a particular CPU budget algorithm. This helps to hide the CPU budget algorithm implementation details from the general thread handling. The CPU budget callouts are turned into CPU budget operations. This slightly reduces the size of the thread control block. All schedulers used the default scheduler tick implementation. The tick scheduler operation is removed and the CPU budget operations are directly used in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This is performance improvement for all threads which do not use a CPU budget algorithm (default behaviour).
2021-03-16score: Add Thread_Configuration::cpu_time_budgetSebastian Huber1-13/+13
Move the CPU time budget to the thread configuration. This simplifies _Thread_Initialize().
2021-02-26score: Fix thread initializationSebastian Huber1-7/+0
Close the thread object if a thread create extension fails. Also call the delete extension to avoid resource leaks in early extensions if a late extension fails. Close #4270.
2020-02-25config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLESebastian Huber1-1/+0
The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_* configuration options. These two options are probably unused, see also: * https://lists.rtems.org/pipermail/users/2019-April/033129.html * https://lists.rtems.org/pipermail/users/2019-April/033130.html Removing them simplifies the configuration. If there is a real user need which shows up after the removal, we can resurrect them on demand. Using CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE would have required the use of the undocumented CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME and CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE configuration options. Update #3874.
2019-04-10posix: _Configuration_POSIX_Minimum_stack_sizeSebastian Huber1-1/+1
Rename to use proper namespace.
2018-12-14score: Static Objects_Information initializationSebastian Huber1-6/+0
Statically allocate the objects information together with the initial set of objects either via <rtems/confdefs.h>. Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621.
2018-10-29posix: Hide POSIX_API_Control by defaultSebastian Huber1-0/+2
Update #2514.
2018-08-08CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZESebastian Huber1-1/+1
Make CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE configurable by the user. Update #3434.
2018-07-05posix: Check for new <pthread.h> prototypesSebastian Huber1-1/+1
Update #3342. Update #3343.
2018-01-25Remove make preinstallChris Johns1-0/+0
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
2017-11-09posix: Remove POSIX_API_Control::schedpolicySebastian Huber1-0/+4
Use the thread CPU budget algorithm to determine the scheduler policy. This fixes also pthread_getschedparam() for Classic tasks. Update #2514.
2017-10-17posix: Remove POSIX_API_Control::schedparamSebastian Huber1-2/+2
Move sporadic server scheduler parameters to POSIX_API_Control::Sporadic. Remove redundant scheduler priority parameter. Update #2514.
2017-10-17score: Rename _Watchdog_Per_CPU_insert_monotonic()Sebastian Huber1-1/+1
Rename _Watchdog_Per_CPU_insert_monotonic() in _Watchdog_Per_CPU_insert_ticks(). Update #3117. Update #3182.
2017-10-17score: Rename watchdog variantsSebastian Huber1-1/+1
Rename PER_CPU_WATCHDOG_RELATIVE in PER_CPU_WATCHDOG_MONOTONIC to highlight the corresponding POSIX CLOCK_MONOTONIC. Rename PER_CPU_WATCHDOG_ABSOLUTE in PER_CPU_WATCHDOG_REALTIME to highlight the corresponding POSIX CLOCK_REALTIME. Update #3117. Update #3182.
2017-10-10posix: Unconditional thread attribute supportSebastian Huber1-29/+0
Update #2514.
2017-10-10posix: Constify default thread processor affinitySebastian Huber1-1/+1
Set default thread processor affinity to all processors of the pre-allocated set. This allows to constify the _POSIX_Threads_Default_attributes. Update #2514.
2017-10-09posix: Remove rtems_pthread_attribute_compare()Sebastian Huber1-8/+0
Update #2514. Close #3174.
2017-10-09posix: Simplify POSIX_API_ControlSebastian Huber1-2/+2
Return stack area via pthread_getattr_np(). Simplify * pthread_attr_setaffinity_np(), and * pthread_attr_getaffinity_np() and let the scheduler do the more sophisticated error checks. Make * pthread_setaffinity_np(), * pthread_getaffinity_np(), * pthread_attr_setaffinity_np(), and * pthread_attr_getaffinity_np() available in all configurations. Update #2514. Close #3145. Close #3168.
2017-01-11Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__Joel Sherrill1-1/+1
2016-09-21score: Rework thread priority managementSebastian Huber1-0/+2
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.
2016-06-22posix: Rework sporadic server scheduling policySebastian Huber1-16/+1
Instead of lowering the priority in case the initial budget is consumed raise the priority for each new period. Restore the normal priority once the initial budget is consumed. This makes it later easier to combine the high priority phase with temporary priority boosts (e.g. via priority ceiling and inheritance). Use the thread lock to protect the POSIX thread attributes instead of the thread state lock. This makes it easier to change the thread priority and keep the POSIX attributes consistent. Fixes a false positive use of uninitialized variable warning.
2016-06-15posix: Fix poradic server initial CPU budgetSebastian Huber1-0/+4
Update #2738.
2016-06-15posix: Use _POSIX_Threads_Sporadic_timer_insert()Sebastian Huber1-1/+14
2016-06-15posix: Remove superfluous codeSebastian Huber1-61/+0
Remove double declarations, useless comments and unused functions.
2016-05-20posix: Rework pthread_join()Sebastian Huber1-14/+0
Rework pthread_join() to use _Thread_Join(). Close #2402. Update #2555. Update #2626. Close #2714.
2016-05-12posix: Avoid Giant lock for some pthread functionsSebastian Huber1-17/+0
Avoid Giant lock for pthread_getattr_np(), pthread_setschedparam() and pthread_getschedparam(). Replace POSIX threads scheduler lock with thread state lock. Update #2555.
2016-04-12posix: Use a dedicated lock for scheduler changesSebastian Huber1-0/+17
Update #2555.
2016-04-06score: Rework MP thread queue callout supportSebastian Huber1-1/+3
The thread queue implementation was heavily reworked to support SMP. This broke the multiprocessing support of the thread queues. This is fixed by this patch. A thread proxy is unblocked due to three reasons 1) timeout, 2) request satisfaction, and 3) extraction. In case 1) no MPCI message must be sent. This is ensured via the _Thread_queue_MP_callout_do_nothing() callout set during _Thread_MP_Allocate_proxy(). In case 2) and 3) an MPCI message must be sent. In case we interrupt the blocking operation during _Thread_queue_Enqueue_critical(), then this message must be sent by the blocking thread. For this the new fields Thread_Proxy_control::thread_queue_callout and Thread_Proxy_control::thread_queue_id are used. Delete the individual API MP callout types and use Thread_queue_MP_callout throughout. This type is only defined in multiprocessing configurations. Prefix the multiprocessing parameters with mp_ to ease code review. Multiprocessing specific parameters are optional due to use of a similar macro pattern. There is no overhead for non-multiprocessing configurations.
2016-03-29score: Remove Thread_queue_Queue::operations fieldSebastian Huber1-0/+12
Remove the Thread_queue_Queue::operations field to reduce the size of this structure. Add a thread queue operations parameter to the _Thread_queue_First(), _Thread_queue_First_locked(), _Thread_queue_Enqueue(), _Thread_queue_Dequeue() and _Thread_queue_Flush() functions. This is a preparation patch to reduce the size of several synchronization objects.
2016-03-04score: Replace watchdog handler implementationSebastian Huber1-4/+1
Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
2016-02-03Use linker set for POSIX User Threads initSebastian Huber1-9/+0
Update #2408.
2016-02-03Optional POSIX Threads initializationSebastian Huber1-8/+1
Update #2408.
2015-07-23score: Introduce Thread_queue_HeadsSebastian Huber1-3/+3
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).
2014-12-18posix: Delete unused _POSIX_Threads_Get()Sebastian Huber1-34/+0
Close #1759.
2014-07-26Delete unused *_Is_null() functionsSebastian Huber1-16/+0
2014-04-03pthreadimpl.h: Conditionalize thread affinity copyingJoel Sherrill1-1/+1
2014-03-31score: PR2152: Use allocator mutex for objectsSebastian Huber1-16/+5
Use allocator mutex for objects allocate/free. This prevents that the thread dispatch latency depends on the workspace/heap fragmentation.
2014-03-31score: Thread life cycle re-implementationSebastian Huber1-1/+3
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-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-03-07Remove trailing whitespace in previous patchesJennifer Averett1-10/+10
2014-03-07posix: Add POSIX thread affinity attribute support.Jennifer Averett1-1/+68
With the addition of pthread affinity information in pthread_attr_t, the existing code for pthread_attr_t had to be adjusted.
2013-07-26score: Create object implementation headerSebastian Huber1-0/+1
Move implementation specific parts of object.h and object.inl into new header file objectimpl.h. The object.h contains now only the application visible API.
2013-07-22posix: Create pthread implementation headerSebastian Huber1-18/+47
Move implementation specific parts of pthread.h and pthread.inl into new header file pthreadimpl.h. The pthread.h contains now only the application visible API.
2013-07-22posix: Include missing header filesSebastian Huber1-0/+1
2013-01-10cpukit: Use Consistent Beginning of Doxygen Group NotationJoel Sherrill1-1/+1
This is the result of a sed script which converts all uses of @{ into a consistent form.
2013-01-10cpukit: Doxygen group fixes and many warnings addressedJoel Sherrill1-1/+1
The output of the modules.html is much improved. Most filesystem and POSIX API related groups are properly nested. Some formatting issues were addressed as were multiple inconsistencies.
2013-01-07posix: Doxygen Clean Up Task #1Alex Ivanov1-65/+68
2012-12-15posix: Doxygen Enhancement Task #2Alex Ivanov1-3/+12
http://www.google-melange.com/gci/task/view/google/gci2012/7988213