Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Locking a pthread to a CPU

0 views
Skip to first unread message

mcg...@bbn.com

unread,
Dec 12, 2002, 3:38:40 PM12/12/02
to
How does one lock a pthread to one CPU in a dual CPU machine. Is there
some notion of a CPU scheduler whereas you can lock a process to CPU0
vs. CPU1?

The environment is a dual Intel P4 running RedHat 7.3 Kernel 2.4.18-3.
Where do I find the tools or apps that would allow me to do this?

Thank you for any help or suggestions.

Michael
mailto:mcg...@bbn.com

Nils O. Selåsdal

unread,
Dec 12, 2002, 4:18:27 PM12/12/02
to
You currently can't do that. With the upcoming 2.6 kernel, atleast
processes can be bound to a cpu probably threads also.

--
Vennlig hilsen/Best Regards
Nils Olav Selåsdal
System Engineer
UtelSystems a/s

Kasper Dupont

unread,
Dec 13, 2002, 2:13:21 AM12/13/02
to
"mcg...@bbn.com" wrote:
>
> How does one lock a pthread to one CPU in a dual CPU machine. Is there
> some notion of a CPU scheduler whereas you can lock a process to CPU0
> vs. CPU1?
>
> The environment is a dual Intel P4 running RedHat 7.3 Kernel 2.4.18-3.
> Where do I find the tools or apps that would allow me to do this?

It should be possible to do it with a kernel module, but I haven't
had oportunity to try it. In 2.6 there will be an ordinary system
call to do it, so you can probably expect the feature to be in
RedHat 9.0, but they may of course backport the syscall to 2.4
kernels. Also read this:

http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#affinity

--
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaa...@daimi.au.dk
Hvem er fjenden i Aalborg?

0 new messages