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/LAUNCHXL-CC1310: the different between event_post and semaphore

Part Number: LAUNCHXL-CC1310


Tool/software: TI-RTOS

The TI RTOS documents says the event_post function unblocks the task which is waitting for the event,   In my understand, if  task one  post a event ,while task two is pending that evevt,  then task two will take charge the CPU,  after task two is done, task one will retake the CPU. which confuse me is , does the task priority influence this procedure? 

The TI RTOS documents slao says  the semaphore_post function readies the first task waiting for the semaphore.if  task one  post a semaphore,while task two is pending that semaphore,  task two will not take CPU if task is still running, am i right?

  • Hi Michael,

    Yes, priority matters. RTOS schedule is such that the highest priority task ready to run takes control of CPU.

    Taking your semaphore example, after task1 posts to the semaphore that task2 is waiting for, then task2 will run as soon as it becomes the highest priority task.

     

    Regards,

    Toby