|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Configuration options for a DynamicExecutor. More...
#include <GREM/execution/Executor.hpp>
Public Member Functions | |
| constexpr bool | operator== (const DynamicExecutorOptions &other) const =default |
| Compare these options to another set of options for equality. | |
Public Attributes | |
| Task::ParallelCount | targetParallelism = static_cast<Task::ParallelCount>(clamp(Thread::hardware_concurrency(), 2u, 16u) - 1) |
| Desired level of parallelism of the chosen executor implementation. | |
Configuration options for a DynamicExecutor.
|
nodiscardconstexprdefault |
Compare these options to another set of options for equality.
| other | the options to compare these to. |
| Task::ParallelCount grem::execution::DynamicExecutorOptions::targetParallelism = static_cast<Task::ParallelCount>(clamp(Thread::hardware_concurrency(), 2u, 16u) - 1) |
Desired level of parallelism of the chosen executor implementation.
If this is less than 2, the chosen executor implementation will always be SequentialExecutor. Otherwise, if multithreading is supported by the platform, and enabled through GREM_USE_MULTITHREADING, the executor will attempt to use a thread pool-based implementation with a number of worker threads that corresponds to this number as closely as possible. Otherwise, the implementation is unspecified, and may fall back to SequentialExecutor.
The default value tries to choose a reasonable degree of parallelism based on the number of available threads reported by the standard library implementation (and in turn, the operating system), which is then decremented by 1 to leave some room for the operating system and other threads. A different estimate may be required for better performance if the program has multiple executors running simultaneously, or if the system has other resource-intensive programs running that are contending for CPU time.