Python Programming Tutorial – 34 – threading

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –






46 responses to “Python Programming Tutorial – 34 – threading”

  1. שירז ברוך Avatar

    this tutorial is awesome, you teach it from the basic and you made threading subject very clear!

  2. Chandrakant Chitalia Avatar

    So will it give different output every time the program is ran?

  3. YouwillneverdefeattheriddleoftheBlackRiders Avatar

    don't name your python file for this tutorial ''. it will interfere with the threading library which has the same name. also, change the value of 10 in the code to something bigger like 1000 to see the context switches. the linux kernel probably handles it differently then the windows kernel so that might be why you need a higher number there.

  4. Ian Cooperman Avatar

    For those of you getting an error involving getName(), use self.getName() instead of threading.currentThread().getName().

  5. ishmam rahman Avatar

    Can someone pls tell me why is there .getname() in print

  6. q zorn Avatar

    will this work on the raspberry pi, opencv, webcam to increase fps? thanks.

  7. Lakpa Sherpa Avatar

    Thanks Bucky, I have been wondering why my computer did not mix the outputs, I had to go to 36 to make it work

  8. PotentialEn3rgy Avatar

    Any suggestions on passing arguments into my run function? Whenever I call start it doesn't seem to pass arguments to run?

  9. They Pheaktra Avatar

    why output always change in each time that I run this program?

  10. Jacob Dykstra Avatar

    Don't forget to return at the end of the run function or the thread will not close and code after the thread might not execute! Great video as always.

  11. What I Wish I Knew Avatar

    If output prints send 10 times and then received 10 times. Make sure you are using single quotes when passing name argument in BuckysMessenger class constructor. example x = BuckysMessenger(name='send out messages')

  12. Vladi Ivanov Avatar

    If the loop is 10 times i see 10 times "send" and after that 10 times "receive", but if the loop is 100 I see first 3 times "send", after that – receive, send, receive, etc. , why is like that ?

  13. alvaro montoya Avatar

    Bucky, is there a safe way to kill the threads? or does python automatically do it at the end of the program? its probably best to close the threads within the program just to be sure all memory is released properly.

  14. harsh soni Avatar

    I don't know why but in my pycharm this programme don't give me an output though there is no error durring debugging and running

  15. Splinter 479 Avatar

    Hej Bucky,
    i was desperately waiting for a practical example on python's multi threading. In the next videos you build a Word Frequency Counter. Wouldn't it be a suitable case to use multi-treading if you split the text first? This way you could explain how to load the threads with the data and merge it afterwards. I'd be thankful to see something like this, you do great tutorials! 🙂

  16. Dark Seid Avatar

    But wouldn't you want to do it in a scenario of only adding which is just cummutative property of addition?

  17. Paul Brandt Avatar

    Thanks Bucky, I have been wondering why my computer did not mix the outputs, I had to go to 10000 to make it work

  18. Ali Vahab Avatar

    Very nice tutorials, cheers:)

  19. Abhishek Kaushik Avatar

    Thanks Bucky,,,,, Cool Videos 😀

  20. Anton R Avatar

    I typed your code exactly the same.. I think.. but the getName()'s don't print out in a jumbled order.. it's 10 "Send out messages" then 10 "Receive messages"

    What could be the cause of this?

  21. Mike Nunez Avatar

    Good videos. Really learned quite a bit of information in an easy to understand way and in a very fast time. I always put your videos at 2x speed, and it's great information in no time at all.

  22. Pyramid132420 Avatar

    Doesn't the Python Global Interpreter Lock prevent multithreading?

  23. rockndancenroll Avatar

    how is that different from multiprocessing?

  24. Aditya Kushwaha Avatar

    why do we use this statement??  – print(threading.currentThread().getName())

  25. Marco Küper Avatar

    Traceback (most recent call last):
      File "D:/PythonLernen/", line 1, in <module>
        import threading
      File "", line 3, in <module>
        class MyMessenger(threading.Thread):
    AttributeError: 'module' object has no attribute 'Thread'

  26. Aaron Avatar

    My computer still did them in order, lol. It's probably too slow to do both threads at once.

  27. marz3335 Avatar

    Bucky — I'm becoming your #1 fan. There are a ton of tutorials on YT but when I watch yours you really SPELL IT OUT for people and that's the key. I've spent all day trying to figure out how I can have a seconds counter running while other code is executing and this may be it. You're something else. ++

  28. robert aspelin Avatar

    Is this how you make multi-core(processor) software?

  29. A Boima Avatar

    Very nice tutorial Bucky..cheers.

  30. Jesse Myers Avatar

    for some reason it doesn't work for me.. it prints the one i start first 10 times then the second, why is that?

  31. Wisdombylearningtruth :) Avatar

    In specific when would we be using threading for a company just curious ?

  32. TheOdy897 Avatar

    Excellent lesson. Nice introduction to parallel programming. Thanks!

  33. Neo Ex Avatar

    Is it possible to make a chat program with this Program/Code (Pycharm)?

  34. Rohan Bharadwaj Avatar

    Hey Bucky. Can you please do a Scala tutorial? I know the really basic stuff since I know Java, but I'd like to learn more. Thanks.

  35. Mrinvinsibleguy Guy Avatar

    Can you do blender tutorials?

  36. Neo Ex Avatar

    What can u make with Phython code?

  37. oldschool1231 Avatar

    For the past 3 months or I've been sidetracked by many different things, so I was surprised today when I saw that Bucky had posted new videos! Not only had he posted some videos, but he had posted loads of them, so he has now put me in the difficult situation of having to watch all of them. Also I had been raring to learn Python for the past few months, so this is just perfect. 

    Welcome back, Bucky. It'd be cool if you responded to this comment. 😛


  38. xxBIGBIRDxx Avatar

    Do swift tutorials PLEAS

  39. Tatrasiel7 Avatar

    I could see this becoming a simple chat tutorial.

  40. Jason Cheladyn Avatar

    Awesome, always wanted to practice this. And with my fav lang!

  41. Snaaapzter. Avatar

    Dude keep teaching i love the way u do, so easy bruh. Go more in depth with python ill stay tuned. Thank you very much 4 ur time. 

  42. Tsuki Avatar

    wow why so many at once?! thanks tho 😀

Leave a Reply

Your email address will not be published. Required fields are marked *