David Kuechenmeister wrote:
Mario,
Thanks for the quick answer. I still haven’t made the attitudinal shift
from working with a big kernel, as in vxWorks, to working with the
microkernel, here. In a big kernel, there is no overhead in sending a
message, releasing a semaphore, etc… as long as you don’t block. But, I’m
not using one of those RTOSs, so I’ll try to make the best of what we have.
Your comment about using timers was interesting, but I see a problem. Say
I have a high speed thread, 800Hz, for example. If I set the system clock to
a high rate, say 1000Hz, my resolution is still only 1/1000 sec, right?
That’s unacceptable for this thread. That is why I want to drive the threads
with a hardware timer that is based on a 10MHz clock. Now my timing jitter
is only 1/(10e6) sec. Much better. Can I connect the QNX software timers to
the hardware interrupt?
Yes … you can use the IRQ8. Let the the ISR send a pulse event to a
handler thread. This thread can do all what you want … sending
messages, pulse events … handling of semaphores and mutexes.
800 Hz is not an issue … our fieldbus resource managers e.g. are
working with a default time resolution of 1ms. The limiting factor
is only the power of your CPU.
Armin
If I can’t, the answer does seem to lie with the
InterruptAttachEvent() function.
Thanks again for the advice.
Regards,
David Kuechenmeister
“Mario Charest” <> goto@nothingness.com> > wrote in message
news:a923kc$4jt$> 1@inn.qnx.com> …
“David Kuechenmeister” <> david.kuechenmeister@viasat.com> > wrote in message
news:a922kc$qum$> 1@nntp.qnx.com> …
I’m trying to synchronize several threads, all in different processes
and
at
different rates, with an interrupt from a hardware timer. The ISR, much
to
my dismay, can’t send messages, release semaphores, or any of the other
non-blocking kernel calls that I am accustomed to using in vxWorks and
other
RTOSs. I need to unblock one or several of these threads, depending on
the
clock tick, i.e. the 100Hz thread runs each tick, the 50Hz on every
other,
the 20Hz every fifth tick, and so on. What I would like to do is send a
message to each thread that needs to unblock from the ISR.
It looks like all an ISR CAN do is return a sigevent destined for a
single
thread. It seems backwards to use the clock to interrupt the processor,
only
to require that the ISR unblock a scheduling thread to wake up the other
threads, but that is the way QNX appears to be leading me.
IMHO ISR are meant to be FAST (an furious), sending messages from inside
an ISR is a very bad idea (imagine if it would have to go over the
network),
the ISR would take forever. So is sending pulses to 100 threads for
example.
Is there a way to direct multiple pulses/events or whatever to the
threads
I
need to unblock, all while still in the ISR?
No.
If your events are based on the timer interrupt why don’t you just used
timers?
Other solution is to not use ISR but rather InterruptAttachEvent(). Then
your handler (which isn’t running in an ISR context) is free to do what
ever it wants (barrier, mutext, semaphore, etc ) to unblock the threads.
Thanks,
David Kuechenmeister
mailto:> david.kuechenmeister@viasat.com
\