Python Intermediate Tutorial #4 - Synchronizing Threads

preview_player
Показать описание
In today's episode, we are talking about synchronizing threads and how to work with locking and semaphores.

Subscribe and Like for more free content!
Рекомендации по теме
Комментарии
Автор

"They're always doing the same shit" His videos are so professional that this makes me crack a smile.

Dr.Cosmar
Автор

Oh my gosh, why you are so underrated...Perfect content 👍🏿

pbfjbic
Автор

To be completely honest i just rewatch your videos in x1, 75 speed just to refresh my memory. So much easier than reading documentation

blusham
Автор

A GREAT and EASY to understand series of videos - I can't believe I knew this channel for so long but didn't watch those and expand my knowledge till now.
Thanks a lot mannn !

dorb
Автор

Well, I'm here, only to say, Thanks so much. Simply and beatiful explanation, of an important concept

rodanmuro
Автор

Great Stuff! Also To Save Time In Writing Try Using F Strings. Instead Of Doing "()".format() You Can Do print(f'{Thread_Num} Was Granted')!

zbmhymy
Автор

Just what I was looking for !! Thanks alot for this perfect example

lazarusmotha
Автор

that was damn impressive. imagine handling connections

gbagba
Автор

great teacher...excellent way to teach us

cibelless
Автор

great tutorial. Thanks a lot helped me

mikehawk
Автор

thank you! you have clear examples and demo

cisanthony
Автор

Great video! Thank you!
Question: should I put "global semaphore" when using the semaphore variable in the access() function? Thanks!

yiheyao
Автор

Just saw your Storie an was very interested

Scheffbuch
Автор

do you recommend watching your videos and taking notes or stopping after each topic and doing some random exercises ?

kraschar
Автор

how does the lock know which variable is being locked? thanks for the lecture

phisicist
Автор

one doubt im a newbie so pls correct me... why have u written global x, lock twice in the functions .. can we write it just once outside both the functions??

aadimanchekar
Автор

also need a thread pool intro to make this series complete.

eugeneL_NE
Автор

import threading
import time

x = 8192

def double():
global x
while x < 16384:
x *= 2
print(x)
time.sleep(1)
print("reached max limit")

def half():
global x
while x > 1:
x /= 2
print(x)
time.sleep(1)
print("reached min limit")

t1 =
t2 =

t1.start()
t2.start()



But, my output is printing the half and double values in different lines. Could you help me understand why?

krinaksanghvi
Автор

Though this guy is a god with the keyboard, the keyboard is aside and the monitor aside and still writes faster than me lol

lawaace
Автор

I have a doubt:

Why dont we need to define semaphore as global semaphore in the access function ?

Edit: Im stupid, its because a semaphore is a mutable data type

purplewarrior