public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: abhinav singh <abhinav_is_in@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How-to write soft real-time programs Kernel-2.6.x
Date: Fri, 16 Apr 2004 09:18:02 -0400	[thread overview]
Message-ID: <407FDD0A.1050904@nortelnetworks.com> (raw)
In-Reply-To: <20040416082057.93380.qmail@web40304.mail.yahoo.com>

abhinav singh wrote:

> So how-to write a simple program(may be a Hello world
> program) which has real-time capabilities.


Something like the following will put you into one of the "realtime" 
scheduling classes, and you will take priority over the normally 
scheduled tasks.


struct sched_param p;
p.sched_priority=50;
if (sched_setscheduler(getpid(), SCHED_RR, &p) < 0) {
	perror("error while setting scheduler class");
	printf("continuing anyways, but results may not be as good\n");
}


The whole issue of soft-realtime is a complicated one, and there are 
many other things that should be done to maximise predictability.


Chris

      parent reply	other threads:[~2004-04-16 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16  8:20 How-to write soft real-time programs Kernel-2.6.x abhinav singh
2004-04-16 10:01 ` Axel Weiss
2004-04-16 13:18 ` Chris Friesen [this message]

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=407FDD0A.1050904@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=abhinav_is_in@yahoo.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