Setting CPU Affinity

Discussion in 'Python' started by Laughlin, Joseph V, May 3, 2004.

  1. When I spawn a new process via spawnv(), how can I set the CPU affinity
    for the newly-spawned process with python?

    Thanks,

    Joe Laughlin
    Phantom Works - Integrated Technology Development Labs
    The Boeing Company
    Laughlin, Joseph V, May 3, 2004
    #1
    1. Advertising

  2. Laughlin, Joseph V

    Mark Hammond Guest

    Laughlin, Joseph V wrote:
    > When I spawn a new process via spawnv(), how can I set the CPU affinity
    > for the newly-spawned process with python?


    The pywin32 (win32all) extensions include the win32 functions for this
    in the win32process module. You should be able to:
    * use spawmv to get the new process ID.
    * use win32process.OpenProcess() to get a process handle.
    * use win32process.SetProcessAffinityMask() to set the affinity.

    Mark.
    Mark Hammond, May 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krishnan

    Processor affinity - HELP

    Krishnan, Jun 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    333
    Krishnan
    Jun 8, 2005
  2. SevDer
    Replies:
    1
    Views:
    475
    Steven Cheng[MSFT]
    Jan 30, 2006
  3. Laughlin, Joseph V

    RE: Setting CPU Affinity

    Laughlin, Joseph V, May 4, 2004, in forum: Python
    Replies:
    0
    Views:
    641
    Laughlin, Joseph V
    May 4, 2004
  4. Replies:
    3
    Views:
    10,876
  5. Replies:
    0
    Views:
    127
Loading...

Share This Page