Skip to contentSkip to conversation

How-to write soft real-time programs Kernel-2.6.x

DISCUSSION abhinav singh 3 participants 3 messages Apr 16, 2004

lore
Share & tools
lore
#0 lore raw

i m a relatively newbie to kernel-2.6.x. But i have information that suggests that kernel-2.6.x has got soft real-time capabilities.

So how-to write a simple program(may be a Hello world program) which has real-time capabilities. I require it for writing a program on kernel-2.6.x that uses the soft real-time capabilities.

Any help in this matter will be highly appreciated.

Abhinav.

__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

#1 lore raw

Am Freitag, 16. April 2004 10:20 schrieb abhinav singh:

Quoted 8 lines

i m a relatively newbie to kernel-2.6.x. But i have information that suggests that kernel-2.6.x has got soft real-time capabilities.

So how-to write a simple program(may be a Hello world program) which has real-time capabilities. I require it for writing a program on kernel-2.6.x that uses the soft real-time capabilities.

Are you looking for www.rtai.org ?

Regards,
Axel

#2 lore raw
In reply to abhinav singh
Quoted 2 lines · abhinav singh

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