Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jun 2009 04:10:27 +1000
From:      David N <davidn04@gmail.com>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        Daniel Underwood <djuatdelta@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: Restrict process(es) to single core
Message-ID:  <4d7dd86f0906261110j4bf1022cw374b1d08564dfd87@mail.gmail.com>
In-Reply-To: <B312F218-C9E6-4FC0-B88A-3660EF0A0E81@mac.com>
References:  <b6c05a470906261040v68a3467cr137e84e4e60e01c3@mail.gmail.com> <B312F218-C9E6-4FC0-B88A-3660EF0A0E81@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/6/27 Chuck Swiger <cswiger@mac.com>:
> 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. =A0I'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; oth=
er
> normal processes you run would get CPU first, but this task would be able=
 to
> use all system resources if nothing else is. =A0I'm not sure whether Free=
BSD
> currently has a way to bind tasks to only running on a subset of availabl=
e
> CPUs (ie, CPUSETs mechanism in Linux, set CPU affinity in Windows, etc).
>
> Regards,
> --
> -Chuck
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"
>

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

Regards
David N



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4d7dd86f0906261110j4bf1022cw374b1d08564dfd87>