在 2018/6/16 15:38, [email protected] 写道:
Counting CPUs is only one problems. You also need to take into account CPU
groups when creating threads. The linked docs suggest using
CreateRemoteThreadEx instead _beginthreadex. Handling affinity settings becomes
more difficult as well (there is scatter, bind etc.). I've seen some code for
it in Clang OpenMP source, for example:
__kmp_affinity_bind_thread(int proc)
It seems Clang also uses system_affinity (_kmp_get_system_affinity) which
contains affinities for all CPU groups.
Unfortunately I am not competent enough to understand how to do it correctly
nor suggest a patch. I have nearly 0 experience in Windows specific programming.
OpenMP is implemented by GCC and consequently out of our control. This
change will have to be done in GCC code and submitted to GCC developers.
Hopefully someone will be interested in it.
--
Best regards,
LH_Mouse
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public