Restrict process(es) to single core

David N davidn04 at
Fri Jun 26 18:10:29 UTC 2009

2009/6/27 Chuck Swiger <cswiger at>:
> 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).
> Regards,
> --
> -Chuck
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

If you're running FreeBSD 7.1 or up, theres a program called cpuset.
man cpuset

I think that's what you're after. Allows binding of process to certain CPUs.

David N

More information about the freebsd-questions mailing list