In the version that I have installed (3.18), it seems that this feature is not supported. However, looking at the MultiThreader
header file, I noticed that the implementation relies on the native OS thread mechanisms. This means that on linux, pthreads are actually spawned, and pthread_t
are directly used for ThreadProcessIdType
, which means that you might be able to use the linux proprietary extensions for core affinities.
Quoting myself from this answer to another question:
Unfortunately, the posix thread API doesn't provide a way to set cpu affinity for threads. You may use the non portable extension provided on the linux platform pthread_attr_setaffinity_np
, with the cpuset
family of functions to configure a thread affinity.
Since the thread will be already running, you will need to get the thread attributes before being able to set its affinity. Linux provides one more non portable function for that: pthread_getattr_np
.
Also, the cpuset
feature must be built in the kernel, however this should be the case on most platforms with multicore support.
references: