Python Thread Tutorial For Beginners 5 - Thread Synchronization Using Locks

preview_player
Показать описание
In this Python Thread Tutorial For Beginners Video we will see Thread Synchronization Using Locks. So what is Thread Synchronization? Thread Synchronization is a mechanism using which it is made sure the two or more threads does not have the access of a shared resource a the same time.Class threading.Lock creates lock objects. Method acquire causes lock to enter locked state. Only one thread may acquire lock at a time so system places any other threads who attempt to acquire lock in blocked state.
----------------------Follow---------------------------------------------
-------------------------Stuff I use to make videos -------------------
Stuff I use to make videos
------------------Facebook Links ----------------------------------------
Рекомендации по теме
Комментарии
Автор

Excellent clarification of serializing multiple thread access to a global variable. This is also precisely why I prefer my first language, FORTRAN IV. Keeping up with the trends in programming is essential, which has its challenges of breaking old habits of not relying on the logic of a first language. I congratulate those who succeed in this area.

baruchba
Автор

Thanks! Simple explanation and to the point. Well done!

kArnAgePT
Автор

Excellent video. Clear concept presentation

vijaykumar-yqsf
Автор

Really good videos! I've been watching alot of the series!! Thanks!

pranaymarella
Автор

Thank you very much! Great explanation and very useful.

boazb
Автор

Your videos are awesome thanks for more information about programming

sherkan_n
Автор

Fab video, could you add the purpose of var.join() as a note somewhere, much appreciated!

SagnikDuttaegor
Автор

Me: so what is the exact result when 2 threads work on the same variable at the same ti...

Him: *UNPREDICTABLE*

raphael
Автор

Why can't this synchronization problem be solved by GIL? since GIL allows a single thread to be interpritred at a time we should have this issue sorted right? Also if we say context switch may happem after some time(since it's a large number), we should get the output always greater than the correct out put isn't it??

prasanhegde
join shbcf.ru