On Thursday 10 January 2002 16:37, [EMAIL PROTECTED] wrote:
> I'm trying to write a rtlinux module with multiple thread. The problem
> is that these threads put a heavy pressure on the system, and I nees
> that linux will always have some processing time.

Well, the only way you can get that is to make sure that your RTL threads 
don't use too much CPU time. If they do, there's *nothing* the Linux 
scheduler can do about it - and that's the way it has to be, or RTL's 
real time performance would be compromized.


> I've tried to use the
> SCHED_OTHER scheduling policy, and modifying the linux task priority
> under a SCHED_RR policy without success.

You should never use SCHED_RR, unless you really *have* to have your 
threads run "concurently". Just as with RTL and RTAI RT threads, it's 
easier to get things simple and reliable if you just design to have RT 
threads run until they explicitly let go of the CPU, or are preempted by 
higher priority RT threads. SCHED_RR is a primitive "RT time sharing 
mode", which isn't what you want in most cases.


> How can I do it? Secondly, on
> a Round Robin scheduling policy, is there a mean to modify the time
> allowed to a task before it is preempted?

Not that I know of - and either way, don't expect either SCHED_FIFO or 
SCHED_RR in user space to have anything like the timing accuracy and 
reliability of RTL or RTAI.

Using Linux/lowlatency, kpreempt or some other user space real time 
solutionl you can cut worst case scheduling jitter down to less than 0.5 
ms, and by configuring a system carefully (no nasty drivers, good 
hardware etc), it's possible to achieve reliability that's practically 
hard real time for deadines in that range.

Still, it won't give you *more* CPU power; it'll just give it to you when 
you need it, rather than a while after you had a buffer under/overrun. 

This is regardless of whether the power just isn't there (ie you need a 
faster CPU), or some kernel space RT threads used it up.


//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
|      Multimedia Application Integration Architecture      |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------------> http://www.linuxdj.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`-------------------------------------> http://olofson.net -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to