Practical example for pthread_mutex_trylock

preview_player
Показать описание
Source code can be found here:

===== Support us through our store =====

===== Check out our website =====

===== Check out our Discord server =====
Рекомендации по теме
Комментарии
Автор

This series really saved me from watching boring teaching assistant videos. Greatly explained. THANK YOU A LOT.

muhammetcavus
Автор

Very very good explanation...complete series is awesome

subbuu
Автор

Interesting concept for explaining the program...Thank you..

narasarajv
Автор

very well explained, thank you.
But I do not understand why we have "no stove available" in the beginning of execution.. aren't all stoves available at that time?

katiabibi
Автор

Nicely explained, it was very helpful : )
But what if a chef occupies a stove that does not have enough fuel, while some other stove have enough fuel for the chef?
The chef will still go home, right?

mustafa
Автор

Shouldn't i be reset to -1 after sleeping? Otherwise the stove 0 is ignored because i gets incremented before the next iteration.

maxtirdatov
Автор

Nicely explain. Please make a video on Shared memory, Message Queue

prashantpatil
Автор

Thanks a lot! Really appreciate the help.

atjhamit
Автор

Is sleeping for some milli seconds a good practice if all the stoves are busy or we can do something better?

beingnikhil
Автор

when if(stovefuel[i]-fuelneeded<0) is true, instead of sending chef home, can we try other stoves?

muhammetcavus
Автор

Maybe i should be set to -1 so that the loop will start again from 0?

HaroldX
Автор

So trylock can be useful if there are more than one critical sections of the same type, right?

sagivalia
Автор

Would like to see these examples applied to some GPUs.

kippie
visit shbcf.ru