in reply to Re: Multi-core and the future
in thread Multi-core and the future

Under Win32 there is an API SetProcessAffinityMask() that allows you to restrict which processor(s) a process can run on. There seems to be a similar call (SetAffinityMask()) on some versions of Linux also.

You would need to write a small command line utility to start the program, get the process handle (probably pid under Linux) and apply the call to it. There may even be existing utilities out there to do this for you.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: Multi-core and the future
by rhesa (Vicar) on Sep 04, 2008 at 17:58 UTC
    On linux that would be taskset (part of the util-linux-ng package).