Pumpkin, Inc.

Pumpkin User Forums

OS_WaitMsgQ() question

If you can't make Salvo do what you want it to do, post it here.

OS_WaitMsgQ() question

Postby ral613 » Tue Nov 01, 2011 12:57 pm

If I wait on a message queue using OS_WaitMsgQ() with a timeout, what happens if the timeout expires, but a message then arrives on the queue before the waiting task gets a chance to execute? Does the waiting task see a timeout and invalid message pointer, does it get the message with no timeout, or something else?

Thanks.
ral613
 
Posts: 4
Joined: Wed Aug 20, 2008 11:00 pm
Location: Ottawa, Canada

Re: OS_WaitMsgQ() question

Postby Andrew » Thu Nov 03, 2011 7:58 am

Once a timeout occurs, all bets are off as to the ststud of the message -- therefore it is undefined, and is most in keeping with "Does the waiting task see a timeout and invalid message pointer."
Andrew
Site Admin
 
Posts: 68
Joined: Mon Nov 30, 2009 6:43 pm

Re: OS_WaitMsgQ() question

Postby ral613 » Thu Nov 03, 2011 8:23 am

OK thanks. What I am seeing is a timeout with a null message pointer, and then if I wait on the Q a second time I return right away with the message that was sent after the original timeout expired but before the waiting task got a chance to run.

I was interested in whether this was as designed, i.e. whether I could count on this behaviour. (Not the null pointer, but getting the message in response to the second Q wait.) Looks like I can.
ral613
 
Posts: 4
Joined: Wed Aug 20, 2008 11:00 pm
Location: Ottawa, Canada


Return to Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron