Troy Davis wrote:
> 
> 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.

Hi Troy,

This can be easily done using (and there are some I've forgotten):

1/ A blocking read on the RTC (see linux/Documentation/rtc.txt) in the
thread loop

2/ A blocking read on a RT fifo in the thread loop (trigger by a write
to the fifo from an RT task)

3/ Using RTAI-LXRT using make_periodic and wait_period calls.

IMHO, 3 is the easiest to implement.

Bear in mind that all these approaches are soft realtime, and so you can
be blocked by kernel activity etc.

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