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_count fails..please help

Hi All,

            with the below lines in a program [below lines forms code on CORE1][CORE0 and CORE1 are attached through IPC]. what i see is Num_count1 and Num_count2 both are zero.

Num_count1 = MessageQ_count(messageQ);

Task_sleep(SLEEP_UNIT);
core1_status = MessageQ_get(messageQ, (MessageQ_Msg *)&MyMsgx, MessageQ_FOREVER);

Num_count2 = MessageQ_count(messageQ);

I have created a MessageQ on CORE1 and it is being opened by CORE0 to input messages. I see MessageQ_put and get being successfull with return status being zero. but still i see both counts as zero..

please help me in solving/understanding this issue

Thanks

R.C.Reddy

  • Hi,

    It looks like it is behaving as expected. Here are the steps as I see it:

    Core0                                 Core1
                                          Message_count returns 0 because nothing is in the queue
                                          Task_sleep
                                          MessageQ_get with MessageQ_FOREVER waits for a message                                    
    MessageQ_put ------------------------>
                                          MessageQ_get returns with the message
                                          Message_count returns 0 because nothing is in the queue                                     

    What is the core1_status value?

    Todd

  • Hi Todd,

                 what you told is correct, i did few experiments and checked that there is a message [at core1] immediately after messageQ_put [at Core0]. core1_status is zero so also core0_status is zero.

    Thanks

    RC Reddy