Restrict process(es) to single core

Chuck Swiger cswiger at
Fri Jun 26 18:06:31 UTC 2009

On Jun 26, 2009, at 10:40 AM, Daniel Underwood wrote:
> Suppose I'm running a multi-threaded program that's utilizing both
> cores of my CPU.  I'm not interested in it's speed, however, and would
> like to free up another core for general purpose. Is there a way
> (without altering/recompiling the program, obviously) to restricting a
> process and its children to a single core?

The simple way would be to use renice to change the process priority;  
other normal processes you run would get CPU first, but this task  
would be able to use all system resources if nothing else is.  I'm not  
sure whether FreeBSD currently has a way to bind tasks to only running  
on a subset of available CPUs (ie, CPUSETs mechanism in Linux, set CPU  
affinity in Windows, etc).


More information about the freebsd-questions mailing list