public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Noe <dpn@isomerica.net>
To: Brian McGrew <brian@visionpro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Two questions about scheduling and threading.
Date: Thu, 08 May 2008 11:47:30 -0400	[thread overview]
Message-ID: <48232092.9090209@isomerica.net> (raw)
In-Reply-To: <C448672F.1E24B%brian@visionpro.com>

On 5/8/2008 11:15, Brian McGrew wrote:
> Also, I know that we're supposed to sit back and let the scheduler do all
> the work for us; but, in the 2.6.16.16 kernel, is there a way to assign a
> specific thread and/or process to a designated processor???  I really need
> to be able to do this because even with the preemptive scheduling, I'm still
> real-time and it's not quite real-time enough!

There are some functions to set CPU affinity from user space:

sched_setaffinity()
sched_getaffinity()

And a user space program:

taskset

All have decent man pages.  They'll allow you to pin a process to a 
particular CPU, or set the normal behavior, which is to try and keep a 
process on the same CPU as long as possible.  There are some other 
utilities mentioned in the related section of the manpages - they allow 
you to tweak scheduler behavior.

Hope that helps.

Cheers,
Dan

-- 
                     /--------------- - -  -  -   -   -
                     |  Dan Noe
                     |  http://isomerica.net/~dpn/

  reply	other threads:[~2008-05-08 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <C4485A81.1E1EF%brian@visionpro.com>
2008-05-08 15:15 ` Two questions about scheduling and threading Brian McGrew
2008-05-08 15:47   ` Dan Noe [this message]
2008-05-08 19:44   ` David Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48232092.9090209@isomerica.net \
    --to=dpn@isomerica.net \
    --cc=brian@visionpro.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox