This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MessageQ reuse help!!!

Other Parts Discussed in Thread: MIDAS

HI !

I have some doubts regarding how to use messageQ for inter-process communication.

In the MCSDK Image processing demo, there is edge detection function. If i have to add one more image processing function which uses multicore what are the modifications that I should use for MessageQ.

In such a case should I create a new local MessageQ and open it after deleting the previous?

  • Hi Mohamed

    There are two ways you could approach adding one more image processing function after edge detection:

    1. In MCIP_CORE_TASK.c, in function slave_main, there is a call to process_rgb. You could add your function right after that and use the output of process_rgb as an input to your new function.

    2. You could use another MessageQ. In MCIP_CORE_TASK.c, in function slave_main, there is a call to "MessageQ_put(reply_queue_id, (MessageQ_Msg)p_msg." Here reply_queue_id points to the local message queue on the Master Core. Instead of sending it to this queue, you can create a new local queue on the slave processor and do a MessageQ_put (new_queue, (MessageQ_Msg)p_msg). You would need a corresponding MessageQ_get, to receive this message, then process it with the function you need, followed by a MessageQ_put (reply_queue_id, MessageQ_Msg)p_msg), which would send each processed slice back to the master core.

    One thing to keep in mind is that typically, once the frame is processed, it is a good idea to use MessageQ_free((MessageQ_Msg)p_msg). Since the image processing demo only works on a single frame, it doesn't free any messages for reuse. However when you are working with multiple frames of data streaming in, you can use this API to reuse messages for incoming frames. Deleting of a MessageQ is typically done only during cleanup, once there is no more need of the queue.

    For your interest, a demo that uses multiple MessageQ_put's and MessageQ_get's across multiple algorithm modules, is at http://processors.wiki.ti.com/index.php/MIDAS_Ultrasound_v4.0_Demo. The section on "Mid_End_Processing" explains the details of MessageQ usage in that demo.

  • I forgot to mention, the IPC User's Guide has more details on the MessageQ API. It is located in the 'ipc_x_xx_xx_xx/docs' folder.