🔒🎓 Mutex - Critical Section [HS]

by Lionfar Teewo

Version 2 (October 9, 2016)

Download (22 downloads)

Mutex - also known as binary semaphore - blocks resources and restrict the access to one process within a critical section.

Example flow: hit the start button multiple times and you will see the result. All fibers will proceed one by one. Until their critical section is done.

You could add this algorithm in any flow to enable parallel launch.
For example when you have a flow that keeps the music volume set to a user defined value/level. Two flows with different values will result in a race condition. You need to prioritize one. This could be done by mutex. One fiber will take ownership of the volume set block and the second flow needs to wait the first is done and release the lock.

I will add this to my keep volume manager and link it here. But it need advanced algorithm, because we have multiple output types and each should get its own lock.

5.0 average rating from 2 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Reviews and ratings can be submitted in the app.