Pumpkin, Inc.

Pumpkin User Forums

Head of Message Queue

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

Re: Head of Message Queue

Postby aek » Thu Dec 06, 2007 4:20 am

quote:
from send1 I get ( wrong):
That may be wrong for your application, but it is the correct behavior as documented in the Salvo manual ... you've sent a pointer, and that pointer now points to something different from what it pointed to when you sent it.

So, to solve your problem, stop sending a pointer and start sending the raw data. I.e. if you watch the msgQ contents, you'll see that the contents of the msgP in each element of the msgQ is the raw data, not the pointer to the static data.

OSSignalMsgQ(MSGQ_ECB_SEND,(OStypeMsgP)data[i]);

and then dereference the msgP "pointer" correctly.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Head of Message Queue

Postby aek » Thu Dec 06, 2007 9:36 am

quote:
What's about OSMsgQCount?
When OSENABLE_FAST_SIGNALING
is set, the count-variable will incremented
by MsgQSend, but not decremented (!) by MsgQWait!
I checked that, both in a runtime test application and also while stepping through code ... the ++ and -- operators on the count are paired in the path through the code properly.

If you have a runtime example that shows otherwise, I'd love to see it.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Head of Message Queue

Postby Bummibaer » Mon Dec 10, 2007 3:58 am


Hi,

O.K.

thats wat i wanted to avoid-> to duplicate
the static memory.

But what is the specific argument
against my solution GetHeader?
So, I have only one block of memory.
I have to watch only for get the pointer
in an continous sequence of the program.

Thanks,

Steffen

Bummibaer
 
Posts: 15
Joined: Thu Sep 13, 2007 11:00 pm
Location: Dresden,Germany

Re: Head of Message Queue

Postby aek » Mon Dec 10, 2007 9:08 am

The most glaring reason is that you are going beyond the API. Only the API is guaranteed -- we could change Salvo internals and your code would no longer work.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Previous

Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron