I had a similar problem and solved it as follows:
It was impossible to trigger a user-task from an rt-task, but it can be done
from a normal (non-rt) Linux kernel module.
The way I did it was to create a bunch of read-only "devices", one each for
100 Hz, 50 Hz, 25 Hz, etc (but you can subdivide the x86 100 Hz jiffy (of
the Alpha's 1 kHz) any way you want.
To execute periodically, a user-task opens and reads from one of these
devices. The read-operation blocks until the next time the associated clock
strikes at which time all tasks that were blocked reading that "device" are
released. (The normal Linux kernel functions sleep_on_interruptible() and
wake_up_interruptible() are perfect for this magic.) The actual "data"
returned from the read are irrelevant, the only thing that's significant is
that the read-operation completes at the rate associated with the device.
Norm Dresner
Fellow Systems Engineer
Radar Systems Engineering Department
Electronic Systems and Sensors Segment
Northrop Grumman Corporation
MS 520
Box 746
Baltimore MD 21203
Voice: (410) 993 - 2096 Mornings; all-day voice-mail
(410) 969 - 8068 Afternoons with answering machine
FAX: (410) 993 - 8084 On-site
(410) 969 - 8068 Afternoons; call first to arrange
E-Mail:Mornings: [EMAIL PROTECTED]
Afternoons: [EMAIL PROTECTED]
> -----Original Message-----
> From: Troy Davis [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, August 24, 2000 12:28 PM
> To: [EMAIL PROTECTED]
> Subject: [rtl] thread scheduling in user space
>
> Hello all-
> I want to create a thread (or process) that executes on a regular
> basis (about 20 times per second - 20 hz) in user space. Doing this
> using the rtlinux thread library in kernel space is very easy, but it
> does not appear to be the case in user space using the regular pthread
> library in linux. Another method of doing this would be to utilize a
> rtlinux timer or thread in a module but I'm unsure of how to trigger a
> function in user space from an event in rtlinux. What I'm trying to do
> is create an interrupt driven read/write function in user space to send
> and poll for messages over a tcp/ip connection. The messages being sent
> over tcp/ip do not need to occur in real-time, so a simple 'is there a
> message? okay - send it or receive it' will work. Anyone have any
> ideas on this?
>
> Troy Davis
> Airborne Data Systems, Inc.
>
> -- [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/
-- [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/