Stuart Hughes wrote:
> 
> 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.

WRONG, with LXRT you just call rt_make_hard_real_time() and you get hard
real time in user space, you cannot just do syscalls and if you want to
have Linux kernel services you have to use a buddy soft real time server
mated to the hard real time process by using standard RTAI services.
There is a wealth of example that show how to do it, quite simple and
easy.

Note that by using rt_allow_nonroot_hrt any user can do hard real time
in user space, provided the needed RTAI module have been installed.

Ciao, Paolo.
-- [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