Re: posix realtime - how to use (was posix 4 extensions)

Craig Schlenter (
Wed, 31 Jul 1996 15:39:06 +0200 (SAST)

On 31 Jul 1996, Mike Robinson wrote:

> Well, we've looked at what is available for real time scheduling, and we've
> started to play around with it. We're looking at fiddling the task structure
> parameters while inside a device driver, to set the calling tasks scheduling
> policy and priority, and we're still trying to figure out how to selectively
> force a re-scheduling so the real time tasks run when we exit from an interrupt
> service routine in the device driver. Our current efforts aren't working too
> well. In particular, we seem to be taking a big performance hit and we seem to
> be missing interrupts, tho' at this stage we can't tell for sure just what is
> happening. Though we do have embedded systems real time experience, we don't
> have a lot of experience with doing this sort of thing with Linux.
> The question is, Does anyone? Do you know of anyone, or is there anyone out
> there who has used real time scheduling with Linux? We'd really like to hear
> from anyone who has used this seriously (or even playfully). Likewise, if anyone
> has got any utilities/samples/guidelines/doco related to Linux realtime, please
> drop us a line.

I got as far as playing with the posix scheduling calls from userspace but
then I changed jobs and it was no longer a priority (no pun intended) so I
haven't done anything more.

Markus Kuhn (spelling?) posted some example code to linux-kernel a while
back (somewhere between 1.3.5x when the calls were added and now). He also
has a very good summary of posix 1003b(?) status for linux. Altavista
should be able to dig it up for you.

I don't think linux is really suited to hard realtime situations since the
kernel itself is non-preemptible. The recent /dev/console denial of
service attack illustrates that there are lots of 'unknowns' at the moment
wrt. just how long it can take before a context switch occurs. There are
quite a few jiffie based delay loops in various drivers as well. I never
quite figured out how the whole interrupt/scheduling/kernel scheme hung
together myself ... perhaps someone more familiar with the code can give
a breakdown of what happens when and where.

You'll also want to lock at the memory locking stuff btw. You don't want
your realtime process to swap to disk at the whim of the VM system.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Craig Schlenter Trusted Network Solutions
Say NO! To SA Telco Internet Monopoly
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -