We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all, Can someone help me with converting a specific function (that receive various parameters) to task function? I'm working with RTX51-Full and I know that maybe the way to do it is to use the system operation - "os_send_message", but I'm not sure. The function is: "void send(bit type, SND_MSG sndMsg, PRTCL_FLD prtclFld, uchar protocol)" P.S. I can't make those variables global. Thanks a lot, Roberto
Refer to: http://www.8052.com/forum/read.phtml?id=30138&top= Jon
Jon Ward wrote: ------------------------------- There are numerous other ways you could handle this. For example, you could create a FIFO and use a counting semaphore. But, I don't know enough about your requirements (like how many tasks call your protocol task, how fast it has to be, and so on). First of all thanks a lot Jon for your help. For clearing my case: 1. Three tasks are calling the send task simultaneously, and the data that each task sends to this task need to be unique. 2. The send task supposes to send message (compose from the data this task received) to other micro on the board. So, that task supposes to be pretty fast. Is the memory pool with the struct solution is the best option here? I think that using memory management functions in tasks that the entire time active is not so good idea (get pool and free pool every few micro seconds). Am I right? Thanks, Roberto
The memory pools implemented in RTX51 use a pre-determined number of fixed-size blocks. The allocation and freeing are pretty fast. You could also use a binary semaphore to guarantee unique access to global variables containing the send task arguments. Jon