How CPUs Use Multiple Cores

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if I tell you I'm multitasking don't believe me the best that I can do as a weak pitiful human is to quickly switch my attention from one single thing to another but is that how your CPU works actually no your CPU relies on a strategy called scheduling where the operating system will decide what sets of instructions or threads will get put through the CPU first second third and so on understanding scheduling is crucial to understanding exactly how modern multi-core CPUs work so we got a little bit of help for this video and we'd like to thank our friends at Intel for their assistance as we run through this thought experiment each thread that your computer is working on gets assigned a value called priority so a thread with a higher priority value will be further ahead in line to get processed by your CPU developers can assign priority values when they write a program and windows can change a thread's priority based on how many system resources it needs and what the exact nature of the instructions are for example if a thread is tied to what you're inputting with a keyboard and mouse such as clicking buttons in your web browser or aiming your weapon in a game it's likely going to get a higher priority by contrast background activities that aren't time sensitive those will get a lower priority similarly developers can assign another value called quality of service or qos to each thread qos is a way for devs to signal to Windows how much processor power a thread might need and while Windows doesn't treat it as important as priority qos is still a factor that the operating system will take into account when it comes to scheduling qos is especially relevant when it comes to power management as the OS can use qos to request a certain frequency from the CPU and the cpu's hardware can decide if it can ramp up to that frequency while staying within power limits that's especially useful on laptops which is all very cool but in terms of our guy doing two things at once analogy priority and qos pertain more to what I'm choosing to do like texting while watching a movie rather than how I'm juggling those two tasks so let's drill down into that traditionally CPU threads would go through one at a time like my brain but this isn't how modern multi-core systems operate especially considering some newer chips even have different kinds of cores all on one package we'll tell you more afterwards from our sponsor Best Buy did you know that Logitech has introduced a few new products to their legendary MX line the MX anywhere 3s is a feature-rich compact Mouse great for working on the go its buttons are quiet and yet satisfying and it can be used on virtually any surface even glass the MX Keys s takes a classic and reliable design and adds a few new features that make life easier such as smart key illumination and automations with their smart actions check them out at Best Buy using the links below one goal in scheduling on multi-core is not to context switch more than is necessary and context switching is just another fancy term for moving a thread from One Core onto a different one in general you want each thread to start and finish on one single core and you want to load balance across course so that none of them are getting overwhelmed and there's been a lot of tweaking over the years to figure out how to do this easily and efficiently such as with libraries which are software resources that sit between the program and the operating system and allow multi-threading without making a developer do a ton of extra coding on newer chips how exactly threading works out across course becomes even more important because of hybrid chips like Intel's Alder Lake lineup these chips have higher performance or P cores and lower performance but more power saving e-course it might be confusing as to why they put e-cores on a desktop CPU where you aren't worried about your battery running out but because e-cores are physically smaller you can actually pack more of them onto a chip meaning you can in some cases get better performance if the scheduler can spread a program out across many e-cores compared to a smaller number of p-cores now even though the windows scheduler will still use p-cores first by default if they're not busy it can then use an e-core for a second thread before using the slower hyper threading feature of a p chord we're also getting to the point where although Windows is still making final decisions on scheduling there are now Hardware assist features on newer CPUs that will actually give advice to Windows so a CPU can look at the incoming workload and then advise windows on the best current core for a certain thread depending on whether Windows wants more performance or better power efficiency so there's a lot that goes into to deciding who gets to go first when it comes to your CPU and a multi-core model can legitimately multitask also my wife can do it somehow if you guys enjoyed this video check out our other videos leave a comment if you have a suggestion for a future fastest Tech quickie and don't forget to subscribe
Info
Channel: Techquickie
Views: 313,048
Rating: undefined out of 5
Keywords:
Id: mk_2-BBGZtA
Channel Id: undefined
Length: 5min 14sec (314 seconds)
Published: Tue Jun 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.