I need two features in RT-Linux that I had in AMX:
1. to wake up a sleeping task with a "message". Message
means nothing more than a copy of a byte string of some
pre-defined length at an address specified by the caller.
Thus
struct mystruct real_data = { 1 , 2
... };
status = ajsend( TaskID , mailbox_number ,
(void*)&real_data );
would awaken a sleeping task (TaskID) and stuff the
contents of real_data (plus perhaps more if the system-wide
pre-defined length of a message was larger than
izeof( real_data) ).
2 . In addition to being able to pass parameters to a
waiting task, each mailbox was a FIFO, queuing
messages/wakeups to each task so that if a task received a
wakeup while it was active, as soon as it tried to sleep it
would be woken again.
I'm porting a program that was originally written using
AMX86 over MS-DOS which used this capability into RT-Linux
(v3) which doesn't have these features. The reason we used
these features in the original program was that with a 33
MHz 80386 we couldn't always guarantee that a task would
finish processing one message before another message came
in -- but we were absolutely certain that the total
processing within a "major cycle" of the schedule was
within the available CPU bandwidth. Of course, we're using
a 700 MHz P-III these days, but the processing requirements
have grown too and we're still needing some kind of FIFO
for messages/wakeups of sleeping pthreads in the kernel.
Sure, I can create a homegrown FIFO for this task -- and
another, slightly different homegrown FIFO for the second
... but with almost anything home-grown there are risks of
race conditions in which a task checks to see if there are
any waiting message and if not it goes to sleep while a
message arrives between the check and the sleeping. (This
isn't a problem in AMX because the scheduler does both the
message posting and the sleeping/waking so it's atomic
there).
I'd like to find a permanent solution if I can to providing
this mechanism within RT-Linux but I haven't been able to
identify one so far. I'm open to all suggestions.
Thanks
Norm
-- [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/