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.
You’ll first need to call the
get_native_handlemember function then pass the obtained handle to a platform specific function to set the thread’s CPU affinity (i.e. pthread_setaffinity_np/SetThreadAffinityMask/…).As to if that’s a good idea: profile & find out…