locked
Control CPU core RRS feed

  • Question

  • Hi,

    how to set user created threads should be run in following core 1357 in 8 core Machine.

    Thanks,

    Naveen.S

    Thursday, February 18, 2016 9:31 AM

All replies

  • Hi,

    Use ProfessAffinity to achive

    https://msdn.microsoft.com/en-in/library/system.diagnostics.processthread.processoraffinity(v=vs.110).aspx

    https://msdn.microsoft.com/en-us/library/system.diagnostics.process.processoraffinity.aspx


    A user friendly computer first requires a friendly user

    Thursday, February 18, 2016 9:40 AM
  • SetThreadAffinityMask

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    • Proposed as answer by Hart Wang Friday, February 26, 2016 7:43 AM
    Friday, February 19, 2016 7:23 AM
  • You can obtain the current thread affinity for all threads of the process by calling the GetProcessAffinityMask function. Use the SetProcessAffinityMask function to specify thread affinity for all threads of the process. To set the thread affinity for a single thread, use the SetThreadAffinityMask function. The thread affinity must be a subset of the process affinity.

    • Proposed as answer by Baron Bi Thursday, February 25, 2016 7:54 AM
    Friday, February 19, 2016 8:39 AM