Skip to content
Snippets Groups Projects
Commit 7cb1a828 authored by Florian Fischer's avatar Florian Fischer
Browse files

[Runtime] use pthread_getaffinity_np to determine default worker count

The value reported by std::thread::hardware_concurrency() can be more
than the available CPUs to the current process for example if EMPER runs
in a container or qemu.
GNU nproc(1) does the right thing and we can take inspiration from them.
The solution is to use pthread_getaffinity_np which fills a CPU set with
all CPU a pthread can be scheduled on.
We use this more precise CPU count if possible.
parent 7dd95bcc
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment