Difference between trylock and lock in C

Difference between trylock and lock in C

CodeVault

3 года назад

27,149 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@LightLord1870
@LightLord1870 - 18.12.2020 23:44

I have watched a few of your videos. I have to say... you explain things well, and you get to the nuts and bolts. Thank you and keep it up! =)

Ответить
@ShubhamKumar-id9sm
@ShubhamKumar-id9sm - 19.12.2020 12:29

What does errno.h do?

Ответить
@narasarajv5278
@narasarajv5278 - 20.12.2020 04:58

Thank you for this video, I am watching all your videos. May i know your name please..

Ответить
@js4773
@js4773 - 18.03.2021 07:32

when mutex_lock was not successful, it can sleep(schedule for other thread). When mutex_trylock() fails, it does the same thing? What is the main difference when mutex_lock and mutex_trylock failed to get the lock?

Ответить
@tumblelandproduction
@tumblelandproduction - 24.03.2021 00:05

If trylock == 0 that means it was not locked, so it locks itself then enters the critical section?

Ответить
@tungbigbang98
@tungbigbang98 - 03.02.2022 21:58

Code vault coming in clutch again, thank you!

Ответить
@Codality
@Codality - 28.02.2022 23:21

THX

Ответить
@NoneStopDamage
@NoneStopDamage - 19.03.2022 23:44

slow down man god damn

Ответить
@oussamasallak9490
@oussamasallak9490 - 11.05.2022 20:01

Great explaination thank you

Ответить
@stefanknezevic6362
@stefanknezevic6362 - 16.10.2022 16:15

Why is there no warning, for reaches end of non-void function (routine)?

Ответить
@jackh4158
@jackh4158 - 04.06.2023 15:10

thanks for the explanation!

Ответить
@caiomazzaferroadami
@caiomazzaferroadami - 16.04.2024 22:14

If I don't care what is executed when I don't get the lock or if I don't want anything to execute when I don't get it, would it be okay to just call trylock and not checking for it's value?

Ответить
@andrelemospiucco5364
@andrelemospiucco5364 - 07.10.2024 00:00

So the reason to use trylock is make the waiting threads do something if else if the locked area is used, instead of just wait

Ответить