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 creation required why?

Hi  All,

           Using CCSV5, MCSDK [bios_mcsdk_02_00_05_17_setupwin32],i started with a project of sending a message from CORE0 to CORE1. Aim of the project is achieved [MessageQ_Put and MessageQ_Get is successfull] and in the meanwhile process, i found few things which i am not able to understand

I am creating a queue at CORE1 and opening it in CORE0 [to do MessageQ_put]. So queue is local to CORE1 and remote to CORE0.

My code is working only if i have created a local queue at CORE0 also [Though i am not using this CORE0 local queue]. 

=================================================

messageQ = MessageQ_create(localqueue,NULL);

status1 = MessageQ_open(remotequeue,&remoteQueueId);

HeapBufMP_Params_init(&HeapBufparams);

MyMsg = (MessageQMsg *)MessageQ_alloc(HEAPID,sizeof(MyMsg));

=================================================

if you look at above steps [CORE0 Code], MessageQ_open is on remote queue whereas i am also creating a localqueue [if i comment the local MessageQ_create line, i see the simulation crashing].My question is "IS IT REQUIRED/NECESSARY THAT FOR A SHARED REGION heapmembuf based IPC mechanism to have both messageQ's created at both cores [if i have only one queue created at core1 and opened by core0, will it not work..is it mandatory that i have to define Q's at both cores]".

Thanks

R C Reddy

  • Hi,

    MessageQ does not require a queue to be create on every core. When you comment out Core0's creation of the Message Queue, do you also remove the MessageQ_open and associated logic from Core1?

    Todd

    [edited on 4/27...added the not]

  • Hi Todd,

                  I have only one way of communication implemented [that is core0 opens a remotequeue and puts message thats all] [core1 has created that remotequeue] and i have not implemented the reverse logic [that is core0 creates a queue which will be opened by core1 ][this is the case which you are talking about and i have not implemented it ].

    The other thing what i noticed is instead of MessageQ_create on CORE0, if i put Task_Sleep(1), the code works without $c$exit. so between IPC_attach and MessageQ_open i already have one Task_sleep [as part of Do While loop for ipc_attach] and further i introduced one more Task_sleep(1) before MessageQ_open [earlier there was MessageQ_create which was introducing some sort of delay now that i have replaced it by Task_sleep(1)], code is not crashing in simulation..

    Todd,

             Any idea why is this behaviour

    Thanks

    RC Reddy

  • RC,

    Are you looping on the MessageQ_open until it succeeds? If core1 has not created the queue yet, the MessageQ_open will fail, so you need to loop until it succeeds.

    Todd