Thread affinity?

Rob T alanb at ucora.com
Tue Dec 3 09:10:02 PST 2013


In core.thread I don't see a portable way to pin a thread to a 
specific core, or at least pin the thread to whatever core it is 
currently running in.

I found this solution, but it's for Windows only.

http://www.gamedev.net/blog/1140/entry-2254424-setting-thread-affinity-on-windows-in-d/

I can find solutions for pthread coded in C/C++, but I'm not sure 
how to apply these solutions when using the D Thread class. I may 
be able hack something out, but I need to be sure it's safe and 
correct.

http://stackoverflow.com/questions/1407786/how-to-set-cpu-affinity-of-a-particular-pthread

Any help is appreciated.

--rt


More information about the Digitalmars-d-learn mailing list