Skip to contentSkip to conversation

rms scheduling

Xenomai-help Steven Seeger 2 participants 5 messages Jan 15, 2008

lore
Share & tools
lore
#0 lore raw

How do you implement RMS scheduling in a userspace app? I didn't set the aperiodic timing mode in the kernel config because it said that it wasn't a good idea. I realize that I'm using one-shot, but I'm porting over software from an older RTAI project that used a periodic timebase of 125us. Since I'm currently configured to use one-shot, I think this may cause problems.

What I want is for all tasks to have their timings be a multiple of some value, and then have all thread timing based around increments of that. So, if I set a task periodic, I want it to start in sync with the other threads. Perhaps the only way to do this is to have threads sync to a conditional variable when they start?

I saw I can use rt_set_timer_mode() to set the timebase for a skin. Would this give me the desired effect?

Steven

#1 lore raw
Quoted 12 lines · Steven Seeger

How do you implement RMS scheduling in a userspace app? I didn't set the aperiodic timing mode in the kernel config because it said that it wasn't a good idea. I realize that I'm using one-shot, but I'm porting over software from an older RTAI project that used a periodic timebase of 125us. Since I'm currently configured to use one-shot, I think this may cause problems.

Quoted 5 lines

What I want is for all tasks to have their timings be a multiple of some value, and then have all thread timing based around increments of that. So, if I set a task periodic, I want it to start in sync with the other threads. Perhaps the only way to do this is to have threads sync to a conditional variable when they start?

No, setting the system timer to periodic mode will get things to work the way you want.

Quoted 5 lines

I saw I can use rt_set_timer_mode() to set the timebase for a skin. Would this give me the desired effect?

Yes.

Signature · 1 line
                                               Gilles Chanteperdrix
#2 lore raw

Then I will have to go back and re-write my code to use jiffies instead of nanoseconds, right? Is there a macro that will return the proper value for future use?

Also, it seems like this rt_timer_set_mode() will make this the timebase for all things using the native skin. However, what if another app wanted a different timebase? This isn't possible, is it?

Thanks,
Steven

Quoted 7 lines

-----Original Message-----
From: Gilles Chanteperdrix [mailto:[email protected]]
Sent: Tuesday, January 15, 2008 9:27 AM
To: Steven Seeger
Cc: [email protected]
Subject: Re: [Xenomai-help] rms scheduling

Quoted 7 lines
Quoted 5 lines · Steven Seeger

How do you implement RMS scheduling in a userspace app? I didn't set

the

Quoted 5 lines
Quoted 1 line

aperiodic timing mode in the kernel config because it said that it

wasn't a

Quoted 1 line

good idea. I realize that I'm using one-shot, but I'm porting over

software

Quoted 1 line

from an older RTAI project that used a periodic timebase of 125us.

Since

Quoted 2 lines

I'm

Quoted 1 line

currently configured to use one-shot, I think this may cause

problems.

Quoted 4 lines
Quoted 4 lines

What I want is for all tasks to have their timings be a multiple of

some

Quoted 1 line
Quoted 1 line

value, and then have all thread timing based around increments of

that.

Quoted 4 lines

So,

Quoted 1 line

if I set a task periodic, I want it to start in sync with the other

threads.

Quoted 1 line

Perhaps the only way to do this is to have threads sync to a

conditional

Quoted 16 lines
Quoted 1 line

variable when they start?

No, setting the system timer to periodic mode will get things to work the way you want.

Quoted 4 lines

I saw I can use rt_set_timer_mode() to set the timebase for a skin.

Would

Quoted 1 line

this give me the desired effect?

Yes.

--
Gilles Chanteperdrix

#3 lore raw
Quoted 3 lines · Steven Seeger

Then I will have to go back and re-write my code to use jiffies instead of nanoseconds, right? Is there a macro that will return the proper value for future use?

This is transparent, you do not have to care about that, provided that you use rt_timer_ns2ticks everywhere, things will work the same way in one-shot mode or periodic mode.

Quoted 4 lines

Also, it seems like this rt_timer_set_mode() will make this the timebase for all things using the native skin. However, what if another app wanted a different timebase? This isn't possible, is it?

Since xenomai 2.4, each skin has its own timebase. Most skins do not have a service such as rt_timer_set_mode to set whether they will be periodic or one-shot, but their module accept a parameter.

Signature · 1 line
                                               Gilles Chanteperdrix
#4 lore raw
Quoted 3 lines

This is transparent, you do not have to care about that, provided that you use rt_timer_ns2ticks everywhere, things will work the same way in one-shot mode or periodic mode.

I didn't do this, of course. :) Oh well. It won't take too long.

Quoted 3 lines

Since xenomai 2.4, each skin has its own timebase. Most skins do not have a service such as rt_timer_set_mode to set whether they will be periodic or one-shot, but their module accept a parameter.

I think there is a disconnect in Xenomai with regards to userspace threading and applications. If I have two applications that use Xenomai threads, it might be nice if they could each operate on a separate timebase (xenomai running in one shot) but of course this could violate RMS if the applications don't play nice.

Anyway, I have my answer. Thanks! BTW, any word on if your watchdog patch will make it in to trunk? I have been using it with great success.

Steven