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.

RTOS/AM5726: Semaphore questions

Guru 24520 points
Part Number: AM5726
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi TI Experts,

Please let me confirm the following question.

[Question]
Can user post the semaphore from Swi?
i.e. Can user use the semaphore for sync even between thread?

According to the the following API, it seems that user can use it not only task sync even but also thread sync event.

 ti -> sysbios -> knl ->semaphore -> Calling Context

If you have any question, please let me know

Best regards.

Kaka

  • Part Number: AM5726

    Tool/software: TI-RTOS

    Hi TI Experts,

    Now customer are thinking the following situation.

    There are three tasks(Task A, Task B and Task C).
    1. Task A is waiting the semaphore of Sem A
    2. Change the Task A priority from Active to inactive(-1)
    3. Task B post the Sem A
    4. Task C get the Sem A

    [Question]
    Does the Task A continue waiting the semaphore even though the Task A status is inactive?
    i.e. when will change the Task A status from inactive to active, does the task A wait the process until getting the semaphore?

    Best regards.
    Kaka

  • Hi Kaka,

    Kaka said:

    [Question]
    Does the Task A continue waiting the semaphore even though the Task A status is inactive?
    i.e. when will change the Task A status from inactive to active, does the task A wait the process until getting the semaphore?

    If a running Task (Task A in your example) blocks on a Semaphore and its priority is changed to -1 (inactive) first and back to a regular priority (> 0), then Task A will continue to remain in the blocked state until the Semaphore is posted. Once the Semaphore is posted, Task A will be added back to its respective ready queue (determined by the new Task priority) and if it is the highest priority Task will resume running.

    Best,

    Ashish

  • Kaka said:

    [Question]

    Can user post the semaphore from Swi?
    i.e. Can user use the semaphore for sync even between thread?

    A Swi can post a Semaphore to unblock a Task.

    The second part of your question is not clear to me. Could you clarify ?

    Best,

    Ashish

  • Hi Ashish,

    Thank you for your answers. I will inform it to our customer.

    Best regards.
    Kaka
  • Part Number: AM5726

    Tool/software: TI-RTOS

    Hi TI Experts,

    Please let me confirm the following questions.
    [Question]
    Would you please teach me what behavior will the TI-RTOS be with following case?

    If you have any question, please let me know.
    Best regards.
    Kaka

  • Hi TIer,

    I do not know why this thread is combined the exist thread... I know that this questions is related to this topics but I think that if add the exist thread which it has already resolved, anyone cannot find this questions... So, please not combine them.

    I re-post this question in new thread.

    Best regrads.
    Kaka