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.

C6678 MessageQ

Hello all,

I can successfully run the MessageQ example project under CCS5.5. However, I am getting error running another project where cores 1-7 write to core 0 (could happen at same time). Basically, core 0 has one reader and all other cores open this MessageQ reader and write to it. IPC document suggests that each Message queue has one reader and multiple writers (SPRUGO6D page 3-11). This fails in my case. the only way to get it to work is to put a breakpoint in each core and run them one after the other so that core 0 receive their message. What are the restrictions on having multiple writers and one reader?

 


Regards,

 

Murad

  • Murad,

    Yes, Your understanding about reader/writer is correct.

    • A reader is a thread that gets (reads) messages from a message queue.
    • A writer is a thread that puts (writes) a message to a message queue.
    • Each message queue has one reader and can have many writers.

    Did you refer the message_multicore example avilable in the IPC package?

    C:\ti\ipc_1_24_03_32\packages\ti\sdo\ipc\examples\multicore\evm667x

    I hope, the thread synchronization is required in your custom code.

    Please go through the section "Thread Synchronization" in the IPC user guide.

  • Hello Pubesh,
    I am using the example you mentioned above and that works fine. The one not working is when cores 1-7 call MessageQ_put() at the same time and core 0 reader try to read them. I am not sure how to attach to this post but I can email you my projects if you like

    Regards,

    Murad
  • Murad,Can you try with some delay before write the message,
    Task_sleep(500*MultiProc_self()); MessageQ_put();
  • Thank you Pubesh,

    will give it a try!

    But even if this works, it doesn't solve the possibility of simultaneous write to core 0 from other cores!

    Regards,

    Murad

  • Murad,

    Ok, you try that. Meantime, As you mentioned in your previous post that, ready to share the customized code to look and provide the suggestion.
    Yes, please share your code through "Insert/Edit Media". You can click the "Use rich formatting" then see the word doc format.
    Here click the "Insert/Edit Media", here you can upload your file(.zip)

  • Thank you Pubesh,

    We got it to work with 7 readers in core 0...one for each core, but we like to have only one reader and 7 writters

    MultiCoreMessageQ.zip

    Regards,

    Murad

  • Murad,
    Glad to hear that works 7 readers. But your requirment is 7 writers. This will be significant improvement. And also thanks for sharing this code here. This will be useful for the future readers.
  • What we need is one Reader that accept messages from 7 writers. The code above doesn't work if all cores sends messages to the one reader in core 0. We fixed the problem by Allocating different message for each core from the heap.

    Regards,

    Murad