This is what a developer wants. The difference you have shown is perfectly helpful. Thank you sir
@Cognitive-Programmer3 жыл бұрын
Thanks a lot for your kind words… 🙏🙏🙏
@GrandTalkShow2 ай бұрын
thats called content. truely under rated video.
@Cognitive-Programmer2 ай бұрын
Thank you so much for your kind words 🙏
@ahshchАй бұрын
well the best explanation of difference between multi threading and multi processing
@Cognitive-ProgrammerАй бұрын
Thank you so much for your comment and appreciation 🙏
@raghvendramishra2862 Жыл бұрын
Great !!!! I have gone through numerous texts and papers, and websites to clearly dig all these questions. But your one video gives answers for all of them. Thanks a lot Sir.
@Cognitive-Programmer Жыл бұрын
Thanks a lot for your comment. Glad to know that it helped 🙏
@Vijay-Yarramsetty Жыл бұрын
by far the most lucid explanation of threading vs multi processing in Python. Thanks very much.
@Cognitive-Programmer Жыл бұрын
Thank you so much 🙏
@Mina.f.a2 жыл бұрын
Amazing teaching skills ! Thank you for teaching me this very effectively two minutes before my interview !!!
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment. Glad that it was of some help. All the best for your interview 🙏
@classicafАй бұрын
Wow, pure joy to watch, loved it sir
@Cognitive-ProgrammerАй бұрын
Thank you so much for your comment 🙏
@akashjain352 жыл бұрын
Now this is what I call quality content. Subbed!
@Cognitive-Programmer2 жыл бұрын
Thank you so much 🙏
@shubhashishsatpathy8736 Жыл бұрын
Great tutorial, really helpful. One question - at 8:26 not sure how setting kill_thread to True is picked up by the thread. If i were not using threading at all and had that while loop running infinitely, setting kill_thread to True later would not have stopped that loop. Why does it stop it for a thread?
@Cognitive-Programmer Жыл бұрын
Hello Thanks for your comment . The thread function is continuously checking kill_thread variable in every iteration, so whenever it will be true, it will be stop the thread Hope it helps Thanks
@shushens2 жыл бұрын
Really like this. I hope you keep making more videos like this one. Kintu mama, threading video gulo diye ekta playlist baniye dile khub bhalo hoto.
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment 🙏 Here is the playlist on Python Multithreading
@Parthiban_Straight_Edge2 жыл бұрын
Great explanation Daksh!! Keep it up
@Cognitive-Programmer2 жыл бұрын
Thank you so Much 🙏
@sunilkoiri10302 жыл бұрын
Awesome demo + explanation
@Cognitive-Programmer2 жыл бұрын
Thank you so much for your comment 🙏
@mohitrathore8808 Жыл бұрын
Bestest Tutorial Ever
@Cognitive-Programmer Жыл бұрын
Thanks for your kind words 🙏
@DevendraSingh-xf6cn2 жыл бұрын
Great Content! Just a question, when you started 2 threads. They both remained in active state. I can understand as 1 thread is running on while loop (infinite) but the other should close after a certain sleep time which is not happening in your case. Please explain: M i missing something here?
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment. Sorry I might not have understood your question properly, but if you're talking about 2 threads I create (in ~9th minute of this video), then both threads are created using same function i.e. working_thread So the behaviour is expected. Hope it clarifies your doubt
@tejasarlimatti84202 жыл бұрын
amazing video
@Cognitive-Programmer2 жыл бұрын
Thanks a lot for your comment 🙏
@pakado2009sp3 жыл бұрын
GREAT VIDEO!!!!!! WELL DONE!
@Cognitive-Programmer3 жыл бұрын
Thank you so much for your comment 🙏🙏🙏
@468hitman Жыл бұрын
Very nicely explained
@Cognitive-Programmer Жыл бұрын
Thanks a lot for your comment 🙏
@Haririsina2 жыл бұрын
You explained it very clear thank you
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment 🙏
@PonnusamyK2 жыл бұрын
Thank you sir, Very usefull
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment 🙏
@temperkan3727 Жыл бұрын
Great video
@Cognitive-Programmer Жыл бұрын
Thank you so much for your comment 🙏
@Vijay-Yarramsetty Жыл бұрын
this is great content. I wish I found it long back.
@Cognitive-Programmer Жыл бұрын
Thanks a lot 🙏
@anaryz_supa26532 жыл бұрын
Thanks! Helped a lot.
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment. Glad to know that it helped 🙏
@sanjaybhatikar2 жыл бұрын
Awesome, thank you!
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment 🙏
@aashishgoyal14363 жыл бұрын
Amazing content sir. Please complete the series. It is really helpful
@Cognitive-Programmer3 жыл бұрын
Thanks for your comment 🙏🙏🙏 sure I am planning to have more videos on this topic.. Thanks again
@kosgeivictor6146 Жыл бұрын
Perfect explanation, thank you.
@Cognitive-Programmer Жыл бұрын
Thanks for your comment 🙏
@haneulkim4902 Жыл бұрын
Thanks for great video. I have few questions: 1. Each thread takes up 100% CPU, my understanding is CPU_i refers to number of cores(i) then when 2 threads take up 100% of CPU_01, CPU_02 it means that in two cores it has one thread each which utilize all of its computation ability? 2. My goal is distribute training deep learning model using tensorflow. I need to check if it is multi-threading/multi-processing before moving onto multi-device distributed training, I am very new to linux systems therefore do not know how to check if tensorflow utilizes all CPU and does multi-threading/processing. Could you recommend me some courses or materials that will help me understand how to analyze CPU usage?
@Cognitive-Programmer Жыл бұрын
Hi Thanks for your comment. irrespective of the number of threads, only 1 CPU will be used. However, in case of Multi Processing, multiple CPU's can be used Hope it helps Thanks
@haneulkim4902 Жыл бұрын
@@Cognitive-Programmer Thanks for the quick reply! I've edited my question, do you mind clarifying my understanding please?
@ajiteshsingh37643 жыл бұрын
Perfect explanation
@Cognitive-Programmer3 жыл бұрын
Thanks a lot for your comment 🙏🙏🙏
@omkarmore21983 жыл бұрын
Excellent
@Cognitive-Programmer3 жыл бұрын
Thanks for your comment 🙏🙏🙏
@chebalid6797 Жыл бұрын
How would I determine the maximum numbers of threads a proccess can have in regards to the computer resources(RAm, cores etc)
@Cognitive-Programmer Жыл бұрын
It's a system limitation and not of the programming language.. You need to check your system parameters.
@chebalid6797 Жыл бұрын
@@Cognitive-Programmer Example I have a linux machine with following Architecture x86_64 CPU(s) : 4 Threads per core : 2 Core(s) per socket : 2 Sockets(s) :1 I have for example a python code, does it mean the most number of threads I can open on this specific code is 2(taking into account the main thread). Am confused about this yet I really want to have a firm understanding
@SodalisUK Жыл бұрын
You can have as many threads as you want, but only 1 that can actually be executing python instructions at any instant because of the GIL.
@popojamesforreal56672 жыл бұрын
Nice video. Pretty helpful :)
@Cognitive-Programmer2 жыл бұрын
Thank you 🙏
@tastaslim2 жыл бұрын
An Insightful Techie I have this doubt, are threads closed automatically by python? I mean what if I don't use join() function, will thread be closed and if yes how does it happen and is there any certain amount of time for that. If you answer it, It will help me a lot. Thank you
@Cognitive-Programmer2 жыл бұрын
Hello Thanks for your comment. A thread will close automatically when it completes. You don't need to explicitly wait for join, but its a good practice to make sure that all your threads are closed before your program / function terminates. Hope it helps. Thanks
@aleksandarpetrovic26323 жыл бұрын
Amazing explanation, tnx
@Cognitive-Programmer3 жыл бұрын
Thanks a lot for your comment 🙏🙏🙏
@vigneshkumar64512 жыл бұрын
Wonderful explanation sir. 🙂🙂 One small suggestion to run and show code using any IDE. Difficult to grab in jupyter notebook.. Expecting ML series from you. Thanks..
@Cognitive-Programmer2 жыл бұрын
Thanks for your valuable feedback. 🙏
@ananyamahapatra65977 ай бұрын
Thank u so much Sir🙂
@Cognitive-Programmer7 ай бұрын
Thank for your comment 🙏
@yt-1161 Жыл бұрын
what is there wasn't GIL. would multi-threading and multi-processing be the same
@Cognitive-Programmer Жыл бұрын
In terms of doing CPU intensive task within a process - Loseley Yes, but from an operating system perspective a thread and process are different. for example, you don't need IPC to communicate between threads. Hope it helps. Thanks 🙏
@Aditya-ne4lk2 жыл бұрын
maybe you should have explained what is the purpose of GIL, i understood what it does, but not why
@Cognitive-Programmer2 жыл бұрын
Thanks for your comment and suggestion. Without GIL, python will have to change completely as the current implementation will not run with GIL Hope it clarifies . Thanks again for your comment 🙏
@SodalisUK Жыл бұрын
The purpose of the GIL is to avoid the need for locking objects every time you want to use or change them. If thread 1 is doing x += 1 and thread 2 is doing x -= 1 then x should stay the same but if they both get x at the same time the result will be wrong. Python also keeps a count of the number of references to an object this way, and if this incorrectly drops to zero, and the object is garbage collected into free memory and the memory reused, all sorts of chaos would happen.
@SodalisUK Жыл бұрын
@@Cognitive-ProgrammerThere is a genuine proposal for a version without the GIL based on a successful proof of concept. But this will still be years away.
@NS-te8jx3 жыл бұрын
you should keep your code on git and share links here, so that we could do quick experiments on our machines while watching the videos.. that would make it more attractive and practical
@Cognitive-Programmer3 жыл бұрын
Thank you for your valuable suggestion.. will implement for later videos