And would it be a good idea to do so if I needed the processor cores running on 100% for a dozen seconds or would I get better performance if I let the system decide how to handle the threads?
What I need is fast execution and I'm worried the system might spend a few seconds before using all the cores, but I haven't found any way of doing this with boost thread.
Your operating system's scheduler should take care of this for you on the order of milliseconds, not seconds. The details depend on which OS you're running on, but one common approach is that when the scheduler runs on an idle CPU, it will check to see if it can steal a thread from another CPU that has too many. That quickly balances the threads across all CPUs.
As a general rule, if you need to set CPU affinity, either you have a very specific and unusual use case, or your operating system has a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With