Setting CPU Affinity

Laughlin, Joseph V Joseph.V.Laughlin at boeing.com
Tue May 4 15:50:54 EDT 2004


> From: Mark Hammond [mailto:mhammond at keypoint.com.au] 
> Sent: Tuesday, May 04, 2004 4:52 AM
> To: python-list at python.org
> Subject: Re: Setting CPU Affinity
> 
> 
> 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.
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

What about on a unix/linux platform?

Thanks,
Joe




More information about the Python-list mailing list