Re: Dumb RTOS Question
- From: galt_57@xxxxxxxxxxx
- Date: 24 Aug 2006 19:36:54 -0700
Dave wrote:
galt_57 wrote:
Starting on my first RTOS project and can't quite see the logic to the
interprocess communications. The Zilog RTOS offers message queues, but
if the queue is empty the reading process is suspended until something
shows up in the queue. Well sorry, that isn't good because my process
has multiple things it needs to monitor periodically. It can't get hung
on just one message queue. I thought a message queue would work or have
an option to work like a ring buffer but that does not seem to be the
case. My concept is to have this process check several "queues" and
then suspend for a safe amount of time before looping back to check them
again. Any sage advice appreciated. Thanks.
The function RZKReceiveFromQueue() includes a wait time parameter.
Also, from the ZiLOG Real-Time Kernel v2.0.0 Reference Manual, page 15:
"You can choose not to block on message queues to receive or send message
queue messages. When this option is chosen, a TIMEOUT error occurs if the
message queue is empty while receiving, or full while sending messages."
And there is also the RZKPeekMessageQueue() function which might do for
you.
If you were to block on each queue for one tick, wouldn't that be safe
since you say "suspend for a safe amount of time before looping back to
check them again"?
That is true. You have a good point. If I want to suspend for a period
of time then I ought to be able to use the timeout on each queue set to
half of that period. I just have not figured out this kooky RTOS stuff.
The peek command copies the entire message out of the queue, which
seems rather pointless. I just can't see the logic of not providing a
non-blocking way to determine if there are one or more messages in the
queue. I mean what is the point of that? Ring buffers worked fine for
talking to ISR's. Why aren't they good enough for an RTOS?
.
- Follow-Ups:
- Re: Dumb RTOS Question
- From: Neil
- Re: Dumb RTOS Question
- References:
- Dumb RTOS Question
- From: galt_57
- Re: Dumb RTOS Question
- From: Dave
- Dumb RTOS Question
- Prev by Date: Re: Dumb RTOS Question
- Next by Date: Re: Dumb RTOS Question
- Previous by thread: Re: Dumb RTOS Question
- Next by thread: Re: Dumb RTOS Question
- Index(es):
Relevant Pages
|