Learn to Program 14 : Python Threads

preview_player
Показать описание


In this part of my learn to program series with Python we'll focus 100% on threads. We'll learn about sleep(), strftime(), the Threading Module, Creating Threads, activeCount(), enumerate(), Subclassing Threads, run(), start(), is_alive(), getName(), setName(), join(), Synchronizing Threads, acquire(), release(), Lock() and more.

Thank you to Patreon supports like the following for helping me make this video

@kyleaisho
@thetwistedhat
vjFaLk
Рекомендации по теме
Комментарии
Автор

Finally I'll be able to understand threads thanks to Python and your tutorials. I have studied these concept in Java and C#, but it's so much better to understand and grasp them with Python, and then learn to apply them with other languages later on.

zackerywilson
Автор

This series is fantastic. I hope that Derek covers Django next.

craigjohnson
Автор

Locking a thread can work... but only if you ensure ALL instances of that thread become locked. It's super easy to mess this up, which is why queues are far more valuable instead of locks.

Neceros
Автор

all your tutoriels need more explain finally thanks for this video

sekmanimohamedamine
Автор

I want to emphasize that threading and queues do not make a program faster. In most cases it will slow down the program. You want threading if you need to have two functions going at the same time, regardless of if they work together.

A common example of this is a chat relay. One thread monitors the chat feed, and the other thread is the main program plucking out the chat in real time.

Neceros
Автор

I really love all your tutorials of python, especially this one !!

yuepan
Автор

You're the best. Your channel has been such a help for me. I wanna know what's your plan once you're finish with this Python Series?

wajahatali
Автор

I see that you've decided to stick to Python series for a bit. I have a suggestion for the end of these series, would you look into making a 'final project' video to put all these concepts to work that you've been covering? It would help to solidify everything and it would show the viewer how a complete project in Python would look like from start to finish. Could be Django or Flask project, or some other Python project since it supports wide range of domains.

RustyZ
Автор

This is amazing! I will definitely recommend this to everyone! Do you know any good programming books?

ilovemen
Автор

+Derek Banas Threading BankAccount program was so cool to do, thanks man!

terraflops
Автор

Why does thread2 end first considering you called thread1.join(). Shouldn't that stop other threads from executing until thread1 has finished?

luca
Автор

How can I simplify the starting and joining of threads?
I mean it becomes dull writing this for say 20 threads.
It doesn't work to write a simple function, because this function does one after another and destroys the whole idea of multi-threading. I somehow think that generators could be helpful, but I don't know how to correctly implement it.
Your help is appreciated!

adrianstobbe
Автор

Helpful videos. Since we are working with python will you ever do a django tutorial in the future ?

pedrogonzalez-ccdy
Автор

sir, plz explain me time.sleep() and join() functions

paavangupta
Автор

Hey, Derek, after you finish covering learn to program, are you planning on covering some other language or can you cover more electronics?

firstvector
Автор

Can you explain better the method join() ??

xristosbart
Автор

Hello Derek, I have a question. This thread lock that you are using o prevent multiple threads from doing the same stuff simultaneously (withdrawing money from the bank):

1. Does the thread stop at the line ''threadLock.acquire()'' and wait for the lock to be released by another thread? Then it continues forward?

2. I think you have said that there can be only one active thread (except main thread?) running at a given time. If so, then what is the point of using this thread lock? Is it useful when one of the threads sleeps?

kvba
Автор

Could you do some series on functional programming?

JosefCZE
Автор

hey derek!
can you explain differentiation and integration please

husainshaikh
Автор

Hey Derek, are you thinking about updating your video series for Android development for newer versions of android studio?

kektus