What other threading topics or examples would you like to see? Let me know!
@boyangbi162
4 жыл бұрын
Thread Safe.
@adasz8369
4 жыл бұрын
How does GIL work
@victordvickie
4 жыл бұрын
Simultaneous process
@_caracalla_
4 жыл бұрын
exatcly
@BlueFlash215
4 жыл бұрын
Hyperthreading would be interesting. I guess that the "Power" of the core (the operations/threads they can handle) is split in half and so instead of 1 thread per core 2 threads per core can be run simultaneously as if there were 2 actual cores. The limitation is just that 2 GHz would cut down to 2x 1GHz?
@JoshuaMK
4 жыл бұрын
Pretty impressive parallel processing with him drawing and talking at the same time
@asmithdev2162
19 күн бұрын
That's concurrency sadly, he's doing two tasks at the same time but not splitting up individual tasks to speed them up so each task still take the same amount of time he just does both at once (concurrency) where as if he was able to have an extra arm or mouth he could type or speak multiple words at once (parallelism)
@chair_smesh
Жыл бұрын
This is the best high level explanation. I was trying to figure out why multithreading isn't the same as parallelism
@allanhenriques2694
3 жыл бұрын
You're seriously underrated man
@hackerzone2002
Ай бұрын
You explain this topic in very easier way bro
@fenixjose17
2 жыл бұрын
Great : Explaining how it happens from "panoramic view" instead of coding as a first step to programming. With a mind mapping, much better !!!
@ChristopherAlvesGuimaraes
Жыл бұрын
That's a very easy to understand and helpful explanation. I found your video after looking for articles do better understand this topic, then I decided to look on youtube and found you. I've already subscribed.
@TechWithTim
Жыл бұрын
Thanks for subscribing!
@p1neapple_pizza522
3 жыл бұрын
So this 11 minute video explains the brief of threading which takes my university 2 hours to comply but still doesn't made me understand. Thank you Tim!
@andy_frank
Жыл бұрын
What a rockstar. Thank you so much for such an easy-to-understand explanation of this
@TheKavlam
2 жыл бұрын
Thank you! Simple, concise explanation. Love your channel.
@TechWithTim
2 жыл бұрын
Thanks for watching!
@yousef5886
2 жыл бұрын
Really clear and concise explanation - thank you so much Tim!
@joxa6119
2 жыл бұрын
best explanation as thread suppose to be explain using figure before the code. kudos to you bro!
@NeutronDev
2 жыл бұрын
Clear and straight to the point. Great explanation!
@pythonAtlasLion
3 жыл бұрын
2.6GHZ = 2 600 000 000 instructions per second , thank u so much tim
@vladislavyurkov9221
3 жыл бұрын
Hello, Tim! I guess, you explained threads better than most of resources I've read before! And now I have some kind of understanding, thank you very much!:)
@Landon_Hughes
3 жыл бұрын
You explained this better than my professor. Thanks!
@behnamsalehi9765
Жыл бұрын
I was really looking for this Thank you
@ollielivingston7060
4 жыл бұрын
This is such a good explanation, really helped me understand the concept
@elielberra2867
Жыл бұрын
Wow your explanation was incredible clear, thank you!
@sandeshnepal7602
2 жыл бұрын
Mr. Tim , Great Explainer
@EchoVids2u
2 жыл бұрын
Best Explanation so far
@Archdemon93
3 жыл бұрын
Great explanation. You earned another subscriber!
@FantaPopRockz
Жыл бұрын
Wow this is an amazing tutorial and so interesting. Thank you!
@abdallah_eldesouky
2 жыл бұрын
good explained video .. thanks bro
@diegomedina8126
2 жыл бұрын
Excellent explanation. But I have some doubts. If I had 20 functions to run at the same time. Should I use multithreading or multiprocessing? What are the pros and cons of each?
@xhir0
4 жыл бұрын
Awesome! I am very interested in concurrency and parallelism in python
@ashutoshbang5836
3 жыл бұрын
Great content! Thanks a lot Tim :)
@sohampatil6539
4 жыл бұрын
First view Notifications ftw
@RileyDailyFacts
4 ай бұрын
What if a thread is waiting for an input and the other threads depends on that input?
@NurhalisaMadukubah
2 жыл бұрын
Great explanation, thank you you so much
@vicyoslinuxofficial2607
2 жыл бұрын
Is the idea of threading in Python the same thing as asynchronous and synchronous in Dart?
@GauravGupta-by1ml
4 жыл бұрын
Impressive explanation.. really liked it..
@hermesingenui2653
3 жыл бұрын
Thanks man !
@Debug8888
2 жыл бұрын
Great explanation!
@Majestal1
Жыл бұрын
So if I run a program using threads, all the threads of the same program are going to get distributed to different cores? Or are they going to stay in the same core?
@ИлюхаЕвдокимов-ч7з
4 жыл бұрын
thank you very much for these threads videos
@vigeshmadanan
4 жыл бұрын
Please make a video on A asynchronous and python async/await
@muradeliyev6291
4 жыл бұрын
i think this will be EXPERT python tutorial #7 topic.
@mohamedalibouchhioua9734
3 жыл бұрын
Dude, you are awesome !!!!!
@oureternalchains9520
3 жыл бұрын
you're saving my ass in college... thank you!
@tapandabrai
4 жыл бұрын
Hey Tim, I got a notification for the 2nd video in this series but seems it's now private...
@Rezthm
3 жыл бұрын
So good explaination ❤️
@saranilsen5482
3 жыл бұрын
Great video, thank you!
@navinormusic
4 жыл бұрын
YES FINALLY THANK YOU SOOOO MUCH!!
@محمدالنائلي-ر7ي
3 жыл бұрын
thank you
@DSevenn
2 жыл бұрын
I guess the part that confuses me is the fact that isn’t sleep(10) technically a process where the computer sleeps for a set amount of time? If so, you mention how the computer moves onto the other thread to print the number 2 while waiting for sleep(10) to finish… but doesn’t this technically mean that you are printing the number 2, while the CPU is simultaneously counting to 10? This is where I get confused as it seems as if it’s undergoing tasks from different threads at the same time?
@valigeorge9110
3 жыл бұрын
great explanation! thx
@moc2130
4 жыл бұрын
well explaine Tim!
@Connected_Chronicles
4 жыл бұрын
Can you please show how deadlock occures ?
@myprogramming5500
3 жыл бұрын
gigahertz - is a billion hertz, mega hertz - million hertz. Several millions operations per second is not that many.
@sivadasakash1
3 жыл бұрын
Please help me out. I want to implement threading/multiprocessing to find an adjacency matrix. The traditional matrix code uses two for loops. I want to reduce the computation time by implementing threading but i am not able to figure it out.
@HighStar9821
3 жыл бұрын
thanks great video
@khalilurrehman223
4 жыл бұрын
2.60ghz is not 2.60 million operations per second but 2.60 billion operations per second. and in case of 4 core processor it is 2.60 x 4 = 10.40 billion operations per second. ghz is giga hertz per second and you know giga means billion. mega means million
@krishj8011
4 жыл бұрын
awesome....
@angelpico3236
4 жыл бұрын
Hey Tim what happened to part 2 of this serie.
@stiffyBlicky
2 жыл бұрын
Wait, so your "print/sleep" example is not something that happens with synchronous python. A sleep would be blocking and threads would need to wait on the sleep to execute the print statement that follows.
@ShopperPlug
2 жыл бұрын
Is it really true that 4 cores are working at the same time as the way we think of it? It seems all 4 cores receives data from one address bus. Ideally true parallelism is when each core has it's own bus and computes data independently. It seems today we have advanced in "multi core" for computing data with each "core" computing data all independently but "programs" not being able to access each core independently due to lack of proper computer architecture, if that makes any sense. I think it's better that each core should have its own address bus, it would obviously be ridiculous to design such cpu and motherboard, would also cost hella expensive. I bet that some company will provide such product for "true parallelism" in the future, already happening... ARM and NVIDIA... This is why Intel and AMD will be inferior not just because of instruction set system.
@luigif6643
3 жыл бұрын
2.6GHz = 2.6 BILION Hz , if 1 operation per cycle (never the case) -> 2.6 billions operations per secod
@PSNGuyWithHair102
4 жыл бұрын
I kind of dislike and don't understand why you went straight to threads without discussing processes, since you very literally can't have threads without processes, since threads are a subset of a process and a process can actually have multiple threads that share the same memory as their parent process. It seems odd you went straight to threads. Maybe you just did not want to go that in depth in the video? Decent video otherwise.
@yogeshdeveloper5346
4 жыл бұрын
Hey Time the volume is low
@rednova87
2 жыл бұрын
1ghz ~ 1 billion actions per second: 1hz = 1 action per second, 1khz ~ 1 thousand actions per second, 1mhz ~ 1 million actions per second, 1 ghz ~ 1 billion. being off by 1000x is not acceptable.
@falconslayer173
2 жыл бұрын
Billion
@gcheese25
Жыл бұрын
saving my ass thanks
@GasimovTV
4 жыл бұрын
When u r sooo early and dont know what to say: Hi
@charlesjsescoto
3 жыл бұрын
.
@hannav7125
3 жыл бұрын
Tim is only 19 years old. Make me feel bad about myself
@MuminovicGoran
4 жыл бұрын
Good video, but mandatory advice :) , don't use analogies such as gears, highways, water flow etc, valves whatever, just describe what the terms are, it is much nicer to hear you say switching between different threads than pointlessly saying cpu can switch gears because it actually can't, a gear would be more like a single thread with increasing frequency and decreasing frequency and dicreasing and increasing torque, which is like pointless to talk about, many people fall into this trap of trying to explain something by explaining something else instead of well explaining the thing they're talking about. But anyway I finally clicked on your video after 3 annoying people, 3rd one tried to pronounce parallelism and was enjoying in amusement how he's having a hard time pronouncing it and therefore making the video about himself and his voice instead of knowledge, I really care less about his amusements I clicked on it to find out what it is and not to listen to some annoying intro. So anyway thanks.
@morthim
4 жыл бұрын
:/
@GTV_367
Жыл бұрын
I’ve done a lot of studying lately and this is the first time someone explained exactly what a cpu is and does🙂🫡
@atwtmvtvftwsgavralps
4 жыл бұрын
Coding day 1: “Hello World” Coding day 2: *creates parallel universe”
@GauravGupta-by1ml
4 жыл бұрын
#Parallel Universe with Infinity thoughts...... Hell yeah man..
@Sanjubaba00007
3 жыл бұрын
69 like very cool
@TheVirtualTim
2 жыл бұрын
There is an important nuance between "process" and "thread". Modern computer operating systems (because very old operating systems didn't do this) support a concept of memory protection. That is to say that one process is allocated some of the main memory (RAM) for it's "code" (instructions -- in some operating systems they refer to these as "text" pages rather than "code" pages -- they are the same idea) and "data" (things like variables -- not code). If a second process attempts to access memory that was not allocated to it, that process will get a segmentation violation (attempt to access data outside it's assigned memory segment). This prevents two different "processes" from overwriting each other's data. But things are different in threads. Here, two threads (forked from the same process) "share" the same memory. The smallest chunk of memory that a program can read or write is a "page" (this is architecture dependent ... 4k is a common size ... but it could be 8k, etc.). Suppose I have a variable ... an integer ... it's value is "5". This only requires one byte of memory (although on a modern OS the integer might occupy several bytes ..... but even a 64-bit integer would only occupy 8 bytes). Assume that is 8 bytes on a "pagesize" of 4k (4096 bytes). There are a LOT of other variables that occupy the SAME page in RAM. This creates a problem. Suppose there are two completely different variables but they happen to reside within the same "page". Two different threads could "read" the value of their variable ... but they really have to read the entire page and then disregard everything *except* the few bytes they care about. Meanwhile suppose they both modify their respective (but unique) variables ... whichever thread "writes" last (because a "write" back to main memory ALSO writes the ENTIRE page) wipes out everything *except* the few bytes that were changed. This means whichever thread "wrote" the page last ... will wipe out the change of the other thread. This is a problem. To solve this, modern operating systems have a concept of a "mutual exclusion lock" on a memory page (the same way that a multi-user database might do "row locking" or "column locking"). Unix operating systems handle this with something called a "mutual exclusion" lock (mtx). If two "threads" try to access the same page (for purposes of modification) then when the FIRST thread reads the page, it will ALSO apply a "mutual exclusion lock" (typically the first "bit" on the page is reserved for this purpose). If that bit is set to '1' then the page is "locked". If a second thread attempts to access the page, it will be told to wait until the mutex bit is cleared (a "spin on mutex" or smtx condition). In multi-processing (two different processes) this isn't a problem because they don't share the same memory segments. But in multi-threading, the threads DO share the same memory segments ... so it is possible for different threads to "step on each other's toes" and the OS is designed to protect against this). BTW, the whole point of multi-threading had to do with efficiency. Processors are VERY fast if the data they have to manipulate is already in the processor registers. But if the data resides elsewhere (if it has to "fetch" the data from RAM ... or storage) then the amount of clock cycles until that fetch or read completes is a veritable ETERNITY for the CPU. So it may as well be put to good use doing something else. Multi-threading vastly made programs more efficient because they could do *something* while long-running steps (such as memory IO or storage IO were being performed) was completed. A single processor core that is capable of multi-threading (aka hyperthreading) even within the *same* core cannot technically execute BOTH threads at the same time (if scheduled to execute on the same core), They can technically execute at the same time if scheduled to run on different cores.
@rohansamanta7819
2 жыл бұрын
Dude you can write a blog with just this comment. Please do it and share the link, I recently started with the whole architecture think. Would appreciate if I get to learn from you too 🙏❤️
@17dragoncut
Жыл бұрын
Excellent explanation thank you
@plontulublalulu
Жыл бұрын
Great comment!
@phantombeing3015
Жыл бұрын
For io intensive task, you dont need multithreading as you can use asynchronous methods. If it's cpu intensive task, multi threading is necessary
@bobfarker4001
Жыл бұрын
Thanks. There's a lot to wrap my head around in there. I'd like to add that you can access memory in another process manually, using readProcessMemory & writeProcessMemory.
@511cvxzlugynskii3
3 жыл бұрын
Tim knows what he's talking about, this is just not another KZitem tutorial. Just mind-blowing explanation.
@animerank4907
4 жыл бұрын
I am literally learning this at my college right now, great explanation Tim.
@neoanderson1865
Жыл бұрын
Tim I just wanted to thank you for taking the time to make this content. I’ve struggled to understand threading for the longest until I came across this video. You rock 🤟🏼
@huey1153
4 жыл бұрын
*Lmao you upload this a day after I just took my operating systems midterm* 😭😭😭 why!!!
@mf2442
2 жыл бұрын
it's pretty hard to find someone who explains coding well to beginners,thank you for helping us newbies start out!!
@SenzoDlomo
4 жыл бұрын
wow, i watched this video for 3 minutes, i couldn't help it but like the video and subscribe right away, that's how good of a teacher you are.
@EricTrang
4 жыл бұрын
The famous joke: Python has multi-threading capability.
@rayhanmahmudshihab
3 жыл бұрын
If I can recall correctly, 1 Ghz means that core can do 1 billion operations per second.
@MagnusAnand
3 жыл бұрын
Your drawing skills are amazing
@RudolfKlusal
Жыл бұрын
I love your channel, but please, learn the stuff first, please. GHz means giga -- a bilion. At one square signal a cpu can do a lot of instructions per just one clock, it's not just one. Same with a memory. Modern CPU with 3 GHz can do (Intel(R) Core(TM) i7-9700) has something like 70 GFlops, meaning at 3GHz it can do 70 bilion instructions per second. And there's no simple conversion rate between GHz and Flops. i7 from 2011 is at similar frequency, but it has much less Flops. Then 0/1 -- it's surely not "an electron," it's just a switch, as you described. As I said -- I love your work what you do for python, I learned a lot from you, but this... is very inaccurate. Thanks 🙂
@alexandruchiriac7212
3 жыл бұрын
Thank you m8! Very easy explanation ... I'm struggled to understand, you make it izi!
@utpalmohane1416
2 жыл бұрын
believe me guys! This is the single most simple and insightful explanation of the Threads.
@nitkarshchourasia2406
5 ай бұрын
🎯 Key Takeaways for quick navigation: 00:01 *🧵 Introduction to Threading and Processor Cores* - Understanding the basics of threading and processor cores. - Processor cores determine the maximum parallel operations possible. - Clock speed of cores and its significance in operation execution. 03:32 *⚙️ Threads and CPU Execution* - Explanation of threads as individual sets of operations. - Threads are assigned to processor cores for execution. - Threading allows scheduling of different operations on the same CPU core. 06:03 *🔄 Concurrent Programming with Threads* - Concurrent programming involves executing threads in different timing sequences. - Threads enable efficient CPU core utilization by switching between operations. - Threads are beneficial for handling tasks asynchronously, preventing program hang-ups. 07:13 *🔄 Single Core vs. Multi-threaded Execution* - Comparison of single-threaded and multi-threaded execution on a single core. - Multi-threading allows overlapping of operations, reducing overall execution time. - Use cases for multi-threading include web applications and gaming for uninterrupted user experience. Made with HARPA AI
@Soumilbharatendu
5 ай бұрын
Excellent description! i was curious that how do you decide whether your code/function needs multi threading(concurrent) or mult processing(parallel execution)?
@tjisanakerr711
Ай бұрын
I was very lucky to come across this video. Great explanation and illustrations
@ИлюхаЕвдокимов-ч7з
4 жыл бұрын
now i see 3 CPUs(12 cores) behind you
@abdullahsoomro6238
9 ай бұрын
Can we say this ? => If a program loads into a memory. It become active (process). A single process is assign to a single physical core. And that program is written in such a way ( different logical parts) that it can run its different logical (threads) part independently. If 1 part (thread) is waiting the other part(thread) can run to increase efficiency. This is called concurrency (max throughput).
@Sparshchokra
Жыл бұрын
Sir, correct my understanding if it is wrong, Please. My Understanding : Lets say 2 CPU Cores are there and one set of multiple threads belong to process P1 and second set of threads belong to process P2, Now P1 running on core1 and P2 running on core2. So is it possible that one of the thread belong to P1 may run on core2 ? I feel that NO because once core is allocated to P1 then the thread belongs to this process will have to run one by on on this core only. Am I correct sir?
@aniceguy2577
4 жыл бұрын
Is this how javascript promises work?
@SMF-t1c
Ай бұрын
each Giga Hertz is actually 1 billion, not a million
@minhlamat2879
6 ай бұрын
very useful video to get into the topic, thank you very much sir
Пікірлер: 177