John Michael Clemens wrote:
> 
> Greetings,
> 
> sorry if this winds up a double/triple post, it doesn't seem to have gone
> though the first time, and my mailer's giving me fits...
> 
> I've been put in charge of a project to use RT-Linux to do some hard
> real-time image processing at 30-60 frames per second.  What I need to do
> is run a userspace program to analyse one image, and somehow interrupt
> that program at every 3 ms (for 30 fps) to do some accounting and book
> keeping, and then interrupt it every 33 ms to tell it to move onto the
> next image.  I'm at a loss for how to go about doing it.
> 
> I can set up two timers in the kernel (one with a period of 3 ms and the
> other with a period of 33), but how do I get these timered interrupts to
> interrupt the user space process?  More importantly, how can I guarantee
> that the user space program has spent at least most of the time actually
> running? (The target system is a 4-way SMP P3 system)..  I don't want to
> run the processing code in the kernel because it's a progressive algorithm
> that would never yield (do I understand that correnctly? it will process
> as much of the image as possible and then move on when it's told, so no
> user space processes would ever run??).
> 
> Any ideas would be a great help... I'm really at a loss for this one, and
> I'll admit i'm still coming up to speed in the real-time world..
> 
> thanks,
> john.c
> 

Hi John,

You can't guarantee anything in a normal userspace process regarding
timing, so you do need to run your progressive algorithm in RT-kernel
space.  You are correct that would lock out Linux/user space if this
does not yield, so you need to carefully architect your design.

My initial suggestion would be to run the progressive task as a low
priority RT task (without making it periodic), and have a slightly
higher priority manager RT task control this.  This would let you
control the progressive task without interfering with with the 3/33 ms
tasks.  Using this control, you can force the progressive task to
suspend for a set time in a given period, thus giving Linux/userspace
some time in which it can be run. 

There are many other approaches that could be used (such as locking
particular processing tasks to one of the SMP processors).  I suspect
other on the list will have some good suggestions.

Regards, Stuart.
-- [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/~rtlinux/

Reply via email to