]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/doc/openmp-environment-variables/gomprtemsthreadpools.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / libgomp / doc / openmp-environment-variables / gomprtemsthreadpools.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: Environment Variable, Implementation specific setting
7
8 .. _gomp_rtems_thread_pools:
9
10 GOMP_RTEMS_THREAD_POOLS -- Set the RTEMS specific thread pools
11 **************************************************************
12
13 Description:
14 This environment variable is only used on the RTEMS real-time operating system.
15 It determines the scheduler instance specific thread pools. The format for
16 :envvar:`GOMP_RTEMS_THREAD_POOLS` is a list of optional
17 ``<thread-pool-count>[$<priority>]@<scheduler-name>`` configurations
18 separated by ``:`` where:
19
20 * ``<thread-pool-count>`` is the thread pool count for this scheduler
21 instance.
22
23 * ``$<priority>`` is an optional priority for the worker threads of a
24 thread pool according to ``pthread_setschedparam``. In case a priority
25 value is omitted, then a worker thread will inherit the priority of the OpenMP
26 primary thread that created it. The priority of the worker thread is not
27 changed after creation, even if a new OpenMP primary thread using the worker has
28 a different priority.
29
30 * ``@<scheduler-name>`` is the scheduler instance name according to the
31 RTEMS application configuration.
32
33 In case no thread pool configuration is specified for a scheduler instance,
34 then each OpenMP primary thread of this scheduler instance will use its own
35 dynamically allocated thread pool. To limit the worker thread count of the
36 thread pools, each OpenMP primary thread must call ``omp_set_num_threads``.
37
38 Example:
39 Lets suppose we have three scheduler instances ``IO``, ``WRK0``, and
40 ``WRK1`` with :envvar:`GOMP_RTEMS_THREAD_POOLS` set to
41 ``"1@WRK0:3$4@WRK1"``. Then there are no thread pool restrictions for
42 scheduler instance ``IO``. In the scheduler instance ``WRK0`` there is
43 one thread pool available. Since no priority is specified for this scheduler
44 instance, the worker thread inherits the priority of the OpenMP primary thread
45 that created it. In the scheduler instance ``WRK1`` there are three thread
46 pools available and their worker threads run at priority four.