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. Advertisements

  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. Advertisements

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:
    417
    Krishnan
    Jun 8, 2005
  2. SevDer
    Replies:
    1
    Views:
    636
    Steven Cheng[MSFT]
    Jan 30, 2006
  3. aardvark
    Replies:
    0
    Views:
    584
    aardvark
    Aug 9, 2007
  4. Replies:
    3
    Views:
    12,629
  5. pavunkumar

    How , system cpu and user cpu times calculates

    pavunkumar, Feb 27, 2009, in forum: C Programming
    Replies:
    1
    Views:
    524
  6. Greg MacDonald
    Replies:
    0
    Views:
    303
    Greg MacDonald
    Nov 21, 2010
  7. Replies:
    0
    Views:
    187
  8. Replies:
    0
    Views:
    234
Loading...