Pumpkin, Inc.

Pumpkin User Forums

pass parameters from one task to other

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

pass parameters from one task to other

Postby jmles » Thu Feb 08, 2007 8:14 am

I need to pass tree parameters from one task to other. What salvo tool could I use for it? I tried with Message Queue but to extract them it enters tree times (one for each parameter) to the waiting task. One of this parameter is an struct, the second parameter is an integer and the last is a char. What could I do?
Posts: 3
Joined: Thu Feb 01, 2007 12:00 am

Re: pass parameters from one task to other

Postby aek » Thu Feb 08, 2007 9:26 am

Pass a pointer to the struct, via a message or a message queue. Then deference the pointer to the element of the struct.

The main issue you may encounter is that while the pointer is persistent, the struct is not. I.e. if you signal the msg at time A and the struct changes at time B and you successfully wait the msg at time C, then the message contents (i.e. the struct that the msg pointer points to) at time C will not be the same as what they were at time A. In more complex OSes, the act of signaling would malloc a buffer and put the struct in it, but Salvo is leaner than that. So keep that in mind.


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

Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests