Can a thread use message communication as well as one-shot timers?
Aref Taidi
aref.taidi at newera-computing.com
Fri Oct 12 17:44:58 CEST 2007
Hello Paolo,
I have solved my problem by using a different approach. The way I was
trying to do this was unnecessarily complicated.
Instead of using a timer from inside the first thread, I have created a
second periodic thread that does the job. The oneshot thread now
monitors the incoming messages as intended and the periodic one does its
work. These two would manage the same state machine and use
semaphore-protected resources. Everything works fine now.
Many thanks,
Aref
-----Original Message-----
From: Paolo Mantegazza [mailto:mantegazza at aero.polimi.it]
Sent: 12 October 2007 08:04
To: Aref Taidi
Cc: rtai at rtai.org
Subject: Re: Can a thread use message communication as well as one-shot
timers?
Aref Taidi wrote:
> Hello everyone,
>
> I have a hard realtime user space thread that uses rt_receivex() to
> receive messages from other threads. I would also like to start a
> oneshot timer from this thread to check things out every second, so
that
> in between the thread can receive messages.
>
> Following some examples in the showroom I make the following calls
with
> appropriate parameters (omitted below) in this order:
>
> rt_task_init_schmod();
> mlockall();
> rt_grow_and_lock_stack();
> rt_make_hard_real_time();
> rt_task_use_fpu(netman_task, 1);
> start_rt_timer(0);
> rt_init_timer();
> rt_insert_timer();
>
> But the above causes the PC to hang needing a reboot. But if I don't
use
> the last 3 function calls everything works, but I won't have a timer!!
> Please can someone tell me what I am doing wrong?
>
Difficult to say. The flow is important but the call params might be
relevant too. Since it seems you are testing something simple senda
small test showing your troubles, as usual.
Paolo.
> Many thanks in advance,
>
> A.T.
>
>
> _______________________________________________
> RTAI mailing list
> RTAI at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>
--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net
More information about the Rtai
mailing list