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.

Linux/PROCESSOR-SDK-AM335X: Mailbox APIs

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

I am porting an application which was written to run on ecos os. There are some ecos mbox apis to which I am not able to find equivalent posix variants.

AFAIK mbox is used as thread synchronization mechanism in ecos, in which one thread writes in mbox and other thread waits and reads from mbox. 

1)  cyg_mbox_create (cyg_handle_t *handle, cyg_mbox *mbox ) // creates mbox in kernel

2) cyg_mbox_put( cyg_handle_t mbox, void *item) //writes data in item

3) void *cyg_mbox_get (cyg_handle_t mbox)  // waits until something is written in mbox and returns pointer to item

I found these mbox api in ti sdk. 

1)mbox_request_channel()

2) mbox_send_message()

3) mbox_client_txdone()

These APIs, I believe, are used for inter-processor communication. So my question is how can use these apis for thread synchronization within same process? Or is there any other better framework to achieve above ecos functionality?

 

  • Hello,

    This is more of a generic Linux/Posix question and you might find better support in more general forums as we tend to focus on the TI adapted parts of Linux (device drivers, board porting, etc.) here.

    It sounds like you are using the mbox for inter-thread communication? If this is the case, then I agree that I don't believe posix provide one primitive for this and you will have to use some combination in order to accomplish the goal. This seems to be the classic producer-consumer and I'm sure you can find several good examples for this.

    You are correct that the mbox found in the SDK is more for IPC, but it, like any other IPC could also be used, but I assume you want something lighter.

    I'm sorry I don't have more to offer.