Obtaining thread Core affinity in C++ 11 through pthreads
问题 I'm trying to set core affinity (Thread #1 goes on first core, Thread #2 goes on second core, ...) while using std::thread in C++ 11. I've already searched around various topics and on the internet and it seems C++ 11 API doesn't provide such low level feature. On the other hand, pthreads come with pthread_setaffinity_np which would be useful if I could get the "pthread_t" value of my std::thread (I don't know if this is human reasonable or at least legitimate asking for it). An example