This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTX Mutex Vs  Binary Semaphore

Hi Experts,

In CMSIS RTX how the mutex and binary semaphore is handled ?

For example, in case of mutex is locked for some hardware peripheral drivers whether the task switch will be disabled ? or by any other means ?

Also where the binary semaphore should be used and where the mutex should be used ?

Parents
  • Hi Reinhard,

    Thanks for the reply.

    Consider thread A is having higher priority and thread B is having least priority. Now thread B is executing and locks the mutex for a peripheral driver. Now the interrupt occurs which triggers thread A and due to preemptive nature thread A activates. Now when thread A is trying to access the same mutex locked peripheral driver of thread B then thread A will be put into waiting state.

    This is my understanding from your answer. Correct me if I am wrong.

    Regards,

    Techguyz

Reply
  • Hi Reinhard,

    Thanks for the reply.

    Consider thread A is having higher priority and thread B is having least priority. Now thread B is executing and locks the mutex for a peripheral driver. Now the interrupt occurs which triggers thread A and due to preemptive nature thread A activates. Now when thread A is trying to access the same mutex locked peripheral driver of thread B then thread A will be put into waiting state.

    This is my understanding from your answer. Correct me if I am wrong.

    Regards,

    Techguyz

Children