How CPUs Use Multiple Cores

  Рет қаралды 319,419

Techquickie

Techquickie

Күн бұрын

Пікірлер: 528
@VanillaSpooks
@VanillaSpooks Жыл бұрын
I'm now going to have nightmares about a CPU with eyes and a mouth...
@CyberDragon10K
@CyberDragon10K Жыл бұрын
That Windows logo is the more unsettling one for me.
@user-op8fg3ny3j
@user-op8fg3ny3j Жыл бұрын
@@CyberDragon10K yh. Who made that?
@IdentifiantE.S
@IdentifiantE.S Жыл бұрын
Good night… 👀
@morelukeplayz6953
@morelukeplayz6953 Жыл бұрын
0:44 - Poggers
@Mystixor
@Mystixor Жыл бұрын
:)
@tannerted
@tannerted Жыл бұрын
I appreciate the explanation you have put together! Quick nit-pick: "Context Switching" is NOT when a process is moved between cores. Schedulers WILL try to avoid moving processes to different cores, but for a different reason (to lower the CPU cache miss rate for said processes). Context switching is when the OS changes which process is running on a given core. Multiple processes will be running on the same core; a context switch is when the OS switches between processes running on the same core. Context switching isn't free (in terms of CPU time/performance), so you are correct in saying that the OS tries to avoid context switching too much. Context switching is necessary to keep all processes responsive as there are often hundreds of processes each vying for CPU time.
@luizgustavomarques8935
@luizgustavomarques8935 Жыл бұрын
Was looking for this reply or going to do it myself
@andrebrait
@andrebrait Жыл бұрын
​@@luizgustavomarques8935same. I literally paused the video to check whether someone had already written that.
@rohansampat1995
@rohansampat1995 Жыл бұрын
WAS about to write this, but you got it. Lol. This video is not the most accurate on the finer points.
@luizgustavomarques8935
@luizgustavomarques8935 Жыл бұрын
@@rohansampat1995 yeah, this is a bit bellow usual quality of information Was expecting then talking program counters at least.
@ChristopherHailey
@ChristopherHailey Жыл бұрын
I just said the same thing before I noticed you posted what i said. You are correct. I think process threads and multithreaded processors are getting confused as well
@necruo7724
@necruo7724 Жыл бұрын
the animations are nightmare fuel, keep up the stellar job guys :)
@flameshana9
@flameshana9 Жыл бұрын
👁 👄 👁
@HeisenbergFam
@HeisenbergFam Жыл бұрын
"If I tell you im multitasking, dont believe me" Even if Linus is not multitasking always make sure to supervise him while he holds stuff
@shivalah
@shivalah Жыл бұрын
Talking and holding are two different things, that's proof Linus cannot multitask and why this is Linus Drop Tips.
@dinozaurpickupline4221
@dinozaurpickupline4221 Жыл бұрын
He eats CPU for breakfast & Then poops multitasking
@lordfalke8117
@lordfalke8117 Жыл бұрын
Hello there
@extremepsykosis
@extremepsykosis Жыл бұрын
I let him hold my newborn once... :D
@dampfwatze
@dampfwatze Жыл бұрын
2:59 Content Switching actually means to interrupt one thread, saving it's context/state, loading the context of another thread and start running it. This all happens on one core and hasn't anything to do with switching the core it is running on. Although this is the mechanism, that might lead to switching the core, a thread is running on.
@rohansampat1995
@rohansampat1995 Жыл бұрын
I dont think the scheduler generates an interrupt but yes. Note interrupts usually are handled through processing of an interrupt queue
@dampfwatze
@dampfwatze Жыл бұрын
@@rohansampat1995 I wasn't really referring to the interrupt system, I just meant the concept of interrupting something running. It is up to the implementation, how this is done.
@ailivac
@ailivac Жыл бұрын
And "quickly switching my attention from one thing to another" IS fundamentally how every multitasking OS works. It's just that on an SMP system you have multiple processors each doing that at the same time.
@rohansampat1995
@rohansampat1995 Жыл бұрын
@@ailivac exactly they got it wrong in the first 30 seconds. new record for the channel.
@jimflagg4009
@jimflagg4009 Жыл бұрын
As a programmer I can tell you multi-threaded programming is hard. You have to make sure your memory variable and other objects are thread safe. That is that more than one thread is not accessing the same variable at the same time. Even then it can make your program unsafe because if one thread fails it need to let the task being done on the other thread know. I some times make workers which work as independent programs and chunk out my tasks. Yes this is not real threading but it is more stable.
@hahasamian8010
@hahasamian8010 Жыл бұрын
Edit: Thanks for clarifying the specifics for me guys ✨️ Guess I wasn't exactly right- Wasn't the PS3 one of the first consumer multi-core computers? I think this was why it was difficult for devs to work with, usually resulting in worse ports, but ending up with some superior titles towards the end of life.
@Youwotm8Tk
@Youwotm8Tk Жыл бұрын
@@hahasamian8010 No, it wasn't the first multi-core/multi-thread processor. In fact the Xbox 360 had 6 threads and the PS3 had 2. The reason it was so hard to program was because it had a really weird/unusual hardware architecture.
@jimflagg4009
@jimflagg4009 Жыл бұрын
@@hahasamian8010 Main Frames or Mini Computers were "multi core" in that they were multi-CPU. Cores came around the early 2000s with the IBM Power4 computers but they could only run Unix and I think some Linux distros no Micro code for other OSs. The first PC CPU I think was Pentium D duo even though there were multi threaded single cores before this.
@GSBarlev
@GSBarlev Жыл бұрын
Chunking out tasks into individual programs is *exactly* how to get the most out of multicore 90% of the time, especially since it ends up allowing you to scale to distributed systems. Even within a single application, structuring your tasks into concurrent futures is way less of a headache than managing synchronous communication between threads.
@codyrap95
@codyrap95 Жыл бұрын
​@@Youwotm8TkSo PowerPC is unusual/weird architecture to you? A lot of companies including Apple were able to make it work, it's just that people weren't used to thinking and programming in the way that PowerPC required
@jwlee21
@jwlee21 Жыл бұрын
I think the context switching analogy given is a bit off… it’s not threads going from core to core per se, it’s which thread is active on a core. And since typically there are more threads running than there are cores on a CPU, the OS has threads that are actively being worked on and others that are not. When a thread that is not active becomes active, then that’s a context switch… the problem with context switches is that it takes time to make that switch which may be a minuscule amount of time. However the problem becomes if too many of these context switches start occurring, then performance starts becoming degraded.
@noergelstein
@noergelstein Жыл бұрын
A context switch is simply the CPU (either real or Hyperthreading core) switching from one thread to another or to an operating system context (for example for file handling, networking etc.). A lot of what makes modern CPUs fast (pipelines and caches have to be flushed, branch predictor might need to relearn the context) does not work across the context switch boundary (for among others also for security reasons). It is like the CPU having to drive to the pitstop, come to a full stop, then later accelerate again. For consumer systems you want frequent switches to make sure that there is never any stutter and for example audio output has no interruptions. For high performance computing where interactivity is non-existant, you might want to lower the switching frequency.
@insu_na
@insu_na Жыл бұрын
The problem is that with a context switch the L1 and sometimes L2 caches need to be invalidated and receive new Data from hopefully L3, suboptimally RAM and awfully a block device. Pushing new data into the caches takes time and needs to happen every time a thread changes.
@ShinyQuagsire
@ShinyQuagsire Жыл бұрын
yeah a context switch happens every time when you move from userland to kernel, or kernel to hypervisor (or userland to hypervisor), ie during a syscall or due to a timer interrupt. It's also why ~most hypervisors are slow AF on virtualized MMIO compared to direct memory mappings, because what used to be a 1 cycle write now requires 100+ cycles of saving/loading registers, possible cache misses, etc and it adds up fast. Moving a thread between cores is called thread migration/core migration, and is expensive because it means it has to flush the caches to memory on the old core and invalidate caches on the new core.
@notenoughmonkeys
@notenoughmonkeys Жыл бұрын
I thinik of it in terms of KZbin channels. High priority - LTT, Medium Priority - TechLinked, Low Priority - TechQuickie, Zero Priority - Channel Super Fun. And if you want an example of setting a priority too low and seeing how it impacts scheduling, just look at when WAN starts each week.
@drk_blood
@drk_blood Жыл бұрын
More like LTT and TechQuickie - High, ShortCircuit and the incoming GameLinked - Medium, and CSF and TechLinked - LOW :p
@negativepremium4100
@negativepremium4100 Жыл бұрын
are we just going to ignore how cursed these animations are ?
@EveningOfficer
@EveningOfficer Жыл бұрын
Yes, we are. *Don’t make me think about them* 😖
@YounesLayachi
@YounesLayachi Жыл бұрын
And the dreaded loading animation with spinning dots , why... Anyone who spent any time with technology will absolutely hate seeing that animation on screen
@pols-czproduction2609
@pols-czproduction2609 4 ай бұрын
I have severe headache trying to understand how that engine works.
@insu_na
@insu_na Жыл бұрын
I would've appreciated it if you went more into the side of Linux scheduling. There are so many different, interesting schedulers. CFS being the default Linux scheduler, MuQSS being an interactivity focused scheduler written by Con Kolivas, PDS being a gaming-focused (more or less) scheduler written by Alfred Chen, BMQ, Cacule, etc. etc. All of them have unique and interesting approaches to this task and all of them are interesting
@GSBarlev
@GSBarlev Жыл бұрын
Probably too technical for the Techquickie audience, but I'd love to see, say, Brodie Robertson do a deep dive.
@ChristopherHailey
@ChristopherHailey Жыл бұрын
I think that's way too tired technical for this channel and would be a much longer topic (many hours)
@loc4725
@loc4725 Жыл бұрын
​@@GSBarlevAn in depth dive would be more of a DMWare thing.
@neiljp-dev
@neiljp-dev Жыл бұрын
I agree that noting alternative scheduling approaches exist would be preferable, and disagree with other comments that it would necessarily need to be more technical. Pointing out that different operating systems do vary in how they do it by default (rather than just 'Windows does x') and why those are relevant would be informative - particularly given the gaming audience LMG typically attracts.
@ChristopherHailey
@ChristopherHailey Жыл бұрын
@@neiljp-dev That's a good point, I think that's where people have an interest here, how does gaming leverage multiple cores. It's really evolving, most games don't handle it well. I remember getting my first hyperthreaded CPU way back when, it had 1 core with 2 threads and the improvement was vast, games would not glitch due to backup processes, one thread would be the game and the other used by background processes...like anything now it's more complex. Just that topic would be a good video.
@SingleRacerSVR
@SingleRacerSVR Жыл бұрын
Video Suggestion :- One thing I notice on lots of your video's, is your team discussing complex hardware & software details in a way us less experienced users can understand. But as a much older person that came from the "DOS ERA", where it was almost common say, to have things like "bad sectors" on mechanical hard-drives. And you just had to except this as a fact of life. One thing that blows me away therefore is today's tech reliability. My last 3 PC's for example ran without fault (baring a software glitch, that I usually created) for 5-7 years without any drama. So could you do a video on your thoughts as to why you think that given the complexity of say CPU & GPU instructions for example - why are computers & phones still (generally) so stable & reliable these days, given that complexity?
@ShinyQuagsire
@ShinyQuagsire Жыл бұрын
Virtual memory and Windows Vista, and I'm not even kidding. Every memory safety feature that Vista added caused a lot of instability in the *short term*, but dramatically increased code quality and reliability in the long term. Before ASLR, libraries would all often be clustered around the same addresses, so accidentally corrupting a pointer or going out of bounds meant you would sometimes hit a valid address and the program would continue running (the consequence being, you just barfed on unrelated memory and have no idea where or how). With Vista and ASLR, every library is extremely far apart, so simple mistakes are no longer tolerated, but it also means simple mistakes are caught easily and early.
@SingleRacerSVR
@SingleRacerSVR Жыл бұрын
Fantastic replies user-rh7 & Shiny. I consider myself an abOve average user - but only because I am always open to listening to what more advanced users like yourselves have to add to my own lack of knowledge. Hence why I am subscribed to LTT. Thanks for you comments ; )
@psoltan
@psoltan Жыл бұрын
I've been working with computers since the IMSAI 8080. I don't know who you are shilling for but computers are LESS stable now than they were 20 years ago. Bad sectors on a disk have nothing to do with intrinsic stability. That was just from manufacturing problems. Try not rebooting your computer or your phone for weeks and then tell me about stability. Software and hardware are much more complex now and testing, at least for software, hasn't kept up. Very smart people write the OS critical code and memory garbage collection hides many problems with less proficient coders. I dread every Windows update because something new will break and I'm not even trying to find problems. Open-source software is the only thing keeping the world from a complete software disaster. Paid programmers are always under pressure to finish sooner rather than write better software. Software only has to be "good enough" and sometimes it's not actually very good at all. If you were not shilling for someone, you would notice that computer hackers cost the economy trillions of dollars every year. Some of this is due to human gullibility but much of it is due to a lack of focus on security when writing software. So when you say that "computers and phones are still generally so stable and reliable these days" it makes you sound clueless.
@kumquat19138
@kumquat19138 Жыл бұрын
@@psoltandaddy chill
@SupaKoopaTroopa64
@SupaKoopaTroopa64 Жыл бұрын
@@psoltan You've got a good point about open-source software. Aside from some games and productivity software, the only proprietary software on my system is the Nvidia drivers, and I bet you can guess what interrupts months of up-time. 99% of the time I restart my computer is because cuda stops working for some unknown reason.
@benjaminclehmann
@benjaminclehmann Жыл бұрын
Context switching isn't moving a thread to a new core. It's pausing a thread and running a different one on that core. A scheduler will occasionally pause a thread and resume it immediately on a different core (e.g. promoting from E core to P core because it needs more juice), but most context switches are pausing a thread to be resumed later, and usually on the same core that it was already running on. In addition, the idea of computer multitasking as starting, stopping, and restarting multiple tasks is not a misconception, it's really actually quite apt and that is the main purpose of scheduling. You have hundreds of processes with thousands of threads running at one time. You probably have 8 cores or less. It is nowhere near possible to run all of them simultaneously. Fortunately for you, most threads need a CPU core only for a small burst, then they need to wait for something like RAM, or disk, or the network, or another core, or the user. While this thread is waiting a different one can be scheduled. The best analogy is that processors multitask exactly how we do, we just have multiple processors in a computer, which allows simultaneous multiprocessing. And then you have that one of these processors is the boss (scheduler) who spends some of their time deciding who ought to do which tasks in which order, though most of their time is still spent doing normal work. Of course you can complicate this with hyperthreading, pipelining, and VLIW which arguably provide "real" multitasking on a single CPU, but for a healthy understanding it's enough to say that 1 thread per core, this thread will run for a very short amount of time (say 10 milliseconds) before it is replaced by a different thread. This understanding is sufficient for many purposes primarily because computers mimic old computers and so this is what (most) software assumes. And arguably is what it ought to assume so that the scheduler can expose this facade leaving the complexity to itself for it alone to handle and optimize.
@shapelessed
@shapelessed Жыл бұрын
Pretty sure context switching is not the process of juggling a thread between cores, but juggling between multiple threads on a single core. It's the core that's switching context, not the thread.
@hampus23
@hampus23 Жыл бұрын
Yeah
@blastinnn
@blastinnn Жыл бұрын
Yes
@laughingseal007
@laughingseal007 Жыл бұрын
I love me some Fast As Techquicke
@oso3557
@oso3557 Жыл бұрын
Actually Humans are great at multithreading. Many background tasks like object recognition, eye-movement, hand coordination and much more is handled by specifically designed parts of the brain. Similar to accelerators in a CPU. Or listening to an audiobook while driving, cooking and talking (if possible) and many other examples of human multitasking. Only becomes problematic when two two tasks try to access the same brain area at once. It's impossible to listen to two people at once, or reading while having a conversation. Also human main task scheduling depends immensely on person and sex. Additionally similar to Task priority on CPUs and Windows, humans have the ability to focus on specfic tasks, reducing and limiting all other not mandatory processes
@ninjadev64
@ninjadev64 Жыл бұрын
Sex*, not gender.
@flameshana9
@flameshana9 Жыл бұрын
A computer can have millions of conversations at the same time whereas we're stuck with just one. That's what multitasking means. An actual thing that requires attention. Unconscious things don't really count in most cases. I can walk and talk but I can't talk and talk. Heck, most people can't even think and talk.
@oso3557
@oso3557 Жыл бұрын
​@@flameshana9 I mean, running background tasks is the majority the cpu and OS have to schedule. Especially on windows with often 100-200 background tasks. But yeah, I agree, that humans don't have "general purpose" elements like CPUs and can only "multithread" as long it's on separate parts of the brain. Although scheduling on the same part of the brain can work for some people.
@oso3557
@oso3557 Жыл бұрын
@@ninjadev64 thanks
@Forty2de
@Forty2de Жыл бұрын
you're saying I'm supposed to be able to breathe and beat my heart at the same time?? That sounds pretty difficult
@Xpurple
@Xpurple Жыл бұрын
It's a lot better than it was 20 years ago. The systems we used then for SMP scheduling where "less than optimal".
@wertywerrtyson5529
@wertywerrtyson5529 Жыл бұрын
It’s still amazing that you could do so much with just one thread back then. Back in the early 2000s I never thought we would get multi core CPUs. But if you had told me that 20 years later we would still be at only about 5ghz I would have laughed and said that in 20 years surely we would have 1thz CPUs or 100ghz at least. My computer from 2003 after all had 10x the mhz of my PC from 5 years earlier.
@Xpurple
@Xpurple Жыл бұрын
@@wertywerrtyson5529 : I was using multi processor sparcstations at that time. Pretty powerful machines back then.
@GSBarlev
@GSBarlev Жыл бұрын
The fascinating thing is that (20 years ago at least), whereas shared-memory multithreading was still going through growing pains, *distributed computing* (running massive tasks on clusters of dozens or thousands of machines) was extremely mature, with a lot of the theory having been developed when "computers" had names like Katherine and Dorothy.
@Xpurple
@Xpurple Жыл бұрын
@@GSBarlev : Yep. Great for tasks that can be split up easily.
@savagepro9060
@savagepro9060 Жыл бұрын
Linus: How CPUs Use Multiple Cores? Single Cores:
@chriswright8074
@chriswright8074 Жыл бұрын
Nice
@flameshana9
@flameshana9 Жыл бұрын
♥ Hot single cores, in your area! ♥
@Eli-zb2yj
@Eli-zb2yj Жыл бұрын
I never use gpu and cpu. I just put a lot of rgb on my printer, and that's enough
@RadioactiveBlueberry
@RadioactiveBlueberry Жыл бұрын
*CMYK
@flameshana9
@flameshana9 Жыл бұрын
@@RadioactiveBlueberry Not as fast as rgb unfortunately.
@sviffls1833
@sviffls1833 Жыл бұрын
Great video as always but I think you guys misunderstood context switching(3:02). As I learned it context switching is when a core changes perimission levels from for example kernel to user. These contexts are how the cpu knows what parts of memory a thread is allowed to read from and write to so that not every program can just go and change important data
@BrianG61UK
@BrianG61UK Жыл бұрын
Context switching is when a core changes from doing one thing (running one thread) to doing another thing (running a different thread). It's slow because all the context (register and flag values etc. in the core) need to be saved to RAM and a new set loaded from RAM. And yes, it's potentially even slower when also changing from, say, kernel space to user space.
@fugoogle_was_already_taken
@fugoogle_was_already_taken Жыл бұрын
No, full context switch is, as OP said, when CPU has to change operation mode from privilaged to unpriviliged (and viceversa), so when jumping between user and kernel space.
@bacon.cheesecake
@bacon.cheesecake Жыл бұрын
1:44 "As the OS can use QOS to request" Linus spitting bars
@LarkyLuna
@LarkyLuna Жыл бұрын
Context switching refers to a single core storing a thread and starting another, not the reassignment of cores Affinity handles the process of preferring to resume threads on the same core
@somestarwarsnerd9068
@somestarwarsnerd9068 Жыл бұрын
Great video, but context switching is more complicated than that. It also happens if the core doesn't change, but when an interrupt causes something else to be executed
@mozzjones6943
@mozzjones6943 Жыл бұрын
Welcome to Tech "quickie" ?
@ChristopherHailey
@ChristopherHailey Жыл бұрын
Actually the whole context switching part was wrong and should be discounted. Some of the other info was ok but quite a bit was "sortta". Not one of the more accurate clips. I think it's a glitch in the video that is problematic, but most of the rest is OK. It's a very complex topic and very difficult to explain in a simplified way.
@mozzjones6943
@mozzjones6943 Жыл бұрын
@@ChristopherHailey Intel employees need firing? Cause that's where the info for this video came from lol
@ChristopherHailey
@ChristopherHailey Жыл бұрын
@@mozzjones6943 You ever play "the telephone game"? The first person says something an then it gets mangled as it goes down the line? Well I got my info from my CS degree and experience not from KZbin (sorry about the flex). If you look there are lots of comments saying the same thing and lots of helpful replies. Most of the video is correct but there are a few "yeah, buts" which are being discussed nicely. I think a few things could have been explained better and the comments are helping, so the system works
@unocualqu1era
@unocualqu1era Жыл бұрын
@@ChristopherHailey Linus Sorta Accurate Tips
@ethor38592
@ethor38592 Жыл бұрын
Wow I forgot that these TechQuickie videos used to be titled "As Fast as Possible." Linus had to catch himself there.
@MarioGoatse
@MarioGoatse Жыл бұрын
I love that you’re hiring teenagers proficient in MS Paint to edit your videos. Really gives it that “old school KZbin feel”.
@johndoh5182
@johndoh5182 Жыл бұрын
Context switching is used when one thread hits a wait state, or if you have lots of tasks to run but very few cores and you get a backup of high priority threads and a low priority thread is running. This typically happens when resources are needed. IF a thread has to wait AND the system needs to run something that has a higher priority THEN you get into context switch. It is NOT simply to switch a thread to a different core, that's like the worst thing a CPU could possibly do because context switching takes many clock cycles. It stores the register values, and other information to run the thread including the code to DRAM, and then the core loads what is needed to run a higher priority thread. Next, I didn't understand most that last part after context switching and I've been working with hardware and software for 40 years now. A programmer, to use many cores has to write the program to use many threads. I don't know every language that exists but many require you to spawn new threads, by writing code. I'm not quite sure how libraries fit into this, but libraries can mean more than one thing. A programming language can have built in libraries so a programmer can write code much easier, and spawning a new thread would be a function that's built into the library for a language. But that doesn't sit anywhere except in the program that was written. If I write a program in C++, the executable will contain the code I wrote, and that will include the sections of the library that the code needs because I called a function in the library. So there is no magical library just floating around, and even when I write a program and then compile it, it's typically a small amount of the programming language library that ends up in my code. Load balancing is something the scheduler can do on it's own, but it has to be working with many threads before it's going to deal with load balancing. Or, there are times when the CPU can switch a thread that's been running on a core for a long time over to another core. THIS is a load balancing process. Spreading threads around to available cores is a normal function of the scheduler and this has nothing to do with programs a coder writes. This is a function of the OS scheduler. So, it can be confusing when you start mixing up the OS with programs the OS is dealing with. It's ALL code that programmers wrote including the scheduler, but when you're talking about load balancing that's more a function of the scheduler and nothing else. When the system is running very few threads it's very simple for the scheduler to simply throw a thread at any available core and rotate threads through all the cores so that no core is doing too much while most cores are idle. When running heavier loads it's still the same thing, the scheduler will throw threads at different cores based on what's available and the load gets balanced with very little effort. A person writing a program doesn't need to worry about this. The only thing they need to worry about is if their app will be more efficient and faster if it's broken up into multiple threads, and programs that run in a very linear way, meaning there is almost nothing you can do in parallel shouldn't be broken up into multiple threads because it takes LONGER to do this.
@alexferguson5346
@alexferguson5346 Жыл бұрын
Those animations are going to haunt my nightmares
@satrioadi7044
@satrioadi7044 Жыл бұрын
I did not need to see an image of CPU with animated eyes and a gaping hole for mouth this early in the morning yet here I am
@glados_creator
@glados_creator Жыл бұрын
are we sure on the definition of context switching ? because for me it is changing between threads on a single core so restoring registers , the stack and code
@glados_creator
@glados_creator Жыл бұрын
what is even more expensive and what is demonstrated is changing the core of a thread so coping it's state and code and yeah memory transfers are slow
@oksowhat
@oksowhat Жыл бұрын
there are also other type of scheduling, not only priority, like round robin and SJF.
@ChristopherHailey
@ChristopherHailey Жыл бұрын
I took an entire CS course in scheduling, it's a big topic
@kiosfriend
@kiosfriend Жыл бұрын
"for a future fast....techquickie" I see what you almost said there ;)
@SDRIFTERAbdlmounaim
@SDRIFTERAbdlmounaim Жыл бұрын
when a cpu can Schedule millions of threads and i a mere human can't properly schedule between my studies and gaming 😂
@r.g7261
@r.g7261 Жыл бұрын
Me: you can't just explain an entire engineering semester's worth of content in 5 minutes Linus: Hold my tips
@joshuastanlick6217
@joshuastanlick6217 9 ай бұрын
I just run everything real-time priority on a 13900KS. Ultimate Performance with core-parking fully enabled. I just play games, and although the PC is not useable during benchmarks like R23 or Passmark, once they complete, the scores increase significantly and everyday use like gaming has the absolute lowest delta for processing. Running everything real-time priority on a computer whose 32 threads are rarely saturated is just fine and almost 100% harmless, for a noticeable improvement in performance that I'd say is even better than what a hefty overclock would grant on its own. I run my 13900KS stock save for Re-BAR and XMP in BIOS. I use Process Lasso for the priorities, CPU sets, and CPU affinities. I didn't touch the actual Windows Scheduler at all.
@laszloperneky8417
@laszloperneky8417 Жыл бұрын
At 0:49 we see the future. Programmers just having a conversation about what will be for dinner, while the code just writes itself :D
@MikeHarris1984
@MikeHarris1984 Жыл бұрын
00:45 this is the GloryThread
@DatBoiTip
@DatBoiTip Жыл бұрын
video idea: can you explain the difference between the different use cases of gpu (work station , gaming ,telsea ect.)
@EnbyCatboyGF
@EnbyCatboyGF Жыл бұрын
I think a great Techquickie would be an explanation about what source code is, while people may have a broad idea about what it is but i feel like not a lot of people know why it's so irreplaceable when it comes to remastering their favorite game.
@StuckOnAFireHydrant
@StuckOnAFireHydrant Жыл бұрын
Took a whole class on this, yet here i am watching again just cause i enjoy these tech quickies. A couple inaccuracies, but very good for just the technology curious people out there.
@clayton_games
@clayton_games Жыл бұрын
I like how he almost went into his "fast as possible" ending and corrected himself to techquickie.
@ari-mcbrown
@ari-mcbrown Жыл бұрын
Correction: context switching happens when processes are being picked up by the OS to delegate to a CPU... Context switching was already a thing with single core CPU's. This is how an OS handles multiple tasks at once.
@alexlandherr
@alexlandherr Жыл бұрын
This explanation touches on what I learned with the “std::thread::hardware_concurrency()” method and threads in C++; threads can behave almost like *truly* parallel processes but aren’t really that. For true parallelism you’d need platform-specific libraries. And not all CPUs support “hyper-threading”-like technology so on a Raspberry Pi 4B “std::thread::hardware_concurrency()” returns the physical core count of 4 cores. On my i7-12700H Linux laptop I get 20 concurrent threads from “std::thread::hardware_concurrency()” which is awesome for stuff that needs it like searching for primes which I wrote a program for in C++ to learn about this very topic.
@hanswurst9120
@hanswurst9120 Жыл бұрын
Shoutouts to Ben Benson at Intel for having very creative parents.
@SupaaMann
@SupaaMann Жыл бұрын
Techquickie as fast as possible would be a fun April fools kind of video
@bogata903
@bogata903 Жыл бұрын
You never talked about what a interrupt is... That would have been a nice thing to add in...
@OldGamerNoob
@OldGamerNoob Жыл бұрын
I want to see the out-of-order processing on multi-core processors be able to take advantage of resources on dormant cores, kind of similar to how the hyper-threaded cores will use dormant resources on their own cores for a second thread (only kind of backward)
@anthonymorris8891
@anthonymorris8891 Жыл бұрын
What has Best Buy been doing differently that would make LMG agree to be associated with them?
@ChristopherHailey
@ChristopherHailey Жыл бұрын
The check cleared? ;)
@adsy6819
@adsy6819 Жыл бұрын
I can multitask, I’m pooping and watching this video at the same time.
@jason6618
@jason6618 Жыл бұрын
Best buy sponsor. Did not expect that.
@nclark5720
@nclark5720 Жыл бұрын
sponsor was a good one!!!! i personally have an MX anywhere 2, it's awesome for me because i play all games using a gamepad from my couch. this mouse works on any surface so i can use it anywhere
@Goodsdogs
@Goodsdogs Жыл бұрын
On the up coming gaming channel you guys should have a video series on how to play: anno 1800 , and etc how to play/start osrs , how to game : mmorpgs , how to game rts’s , how to game puzzle games and which ones are great for beginners to masters
@Goodsdogs
@Goodsdogs Жыл бұрын
I don’t have any experience being a video writer but I do have editing and lots of ideas 😂
@kipchickensout
@kipchickensout Жыл бұрын
As a developer, I can confirm 0:50 is exactly how I write my code
@doctor_gee
@doctor_gee Жыл бұрын
I look in task manager and see I'm running 3200 threads with barely anything running. How Windows juggles those threads between my 8 (16) CPU cores is pretty amazing.
@cadenchurchill4296
@cadenchurchill4296 Жыл бұрын
Me: I’m a smart adult educating myself about tech with Linus! Also me: pee cores, hee hee 😂😅
@youcefdz5598
@youcefdz5598 Жыл бұрын
5:00 actually some studies found that women multitask much better than men
@RaxXxvell
@RaxXxvell Жыл бұрын
Very informative for someone who already knows most of this, but it takes half the video to describe the scheduler on a single core, then what gets avoided and that libraries help together with the hardware itself, but the actual part of how the multitasking is done and how threads are executed on multiple is packed into 10 seconds with a small list. I miss a little: and that all culminates into etc etc. and a little more explanation there. Still enjoyed the video though.
@addledhead
@addledhead Жыл бұрын
It's like they were trying to animate "It's so bad it's good" but stopped halfway
@jtmcdole
@jtmcdole Жыл бұрын
That chip animation is nightmare fuel.
@epicmetod
@epicmetod Жыл бұрын
0:04 As a what?
@stalememe3305
@stalememe3305 Жыл бұрын
That CPU with eyes is REALLY uncanny who made this!?
@flameshana9
@flameshana9 Жыл бұрын
*Windows Defender:* Imagine following rules. I'll scan your system whenever I darn well please. And I'll make _sure_ to do it while you're working.
@AutumnRain
@AutumnRain Жыл бұрын
not too found of their eyes and mouths but i'm not gonna make fun of CPUs too much. they get the job done
@usopenplayer
@usopenplayer Жыл бұрын
Multitasking: it's actually like what humans do, switching from one task to another. But really only working on one thing at a time. Parallel programming: doing multiple things on different cores. Threads: a group of instructions that the scheduler can juggle for multitasking or execute in parallel, depending on the code. Context switch: when you are switching tasks, I usually see it referred to switching between OS library and regular applications. Could be same core or different core.
@jedward3282
@jedward3282 Жыл бұрын
Isn't the scheduler doing tasks one at a time? So is there any real multitasking going on?
@CMDR_John_Crichton
@CMDR_John_Crichton Жыл бұрын
3:16 Are we just not going to talk about how each of the pistons in the engine animation are going in opposite directions?
@sam19953
@sam19953 Жыл бұрын
Damn, (Embedded Linux) Scheduling will be a topic of my exam next week amongst many other things.
@Jon717
@Jon717 Жыл бұрын
3:59 The Spiffing Brit build
@SirCrest
@SirCrest Жыл бұрын
bruh why is that CPU deep throating spools
@commandurrazor
@commandurrazor Жыл бұрын
Hey for a future episode (or maybe something to test at labs) can you make a "final" showdown of round vs flat ethernet cables? I keep seeing "they're worse for performance and interference" but other people saying the interference isn't really a problem for home network settings so I'm not sure what to think..
@Random_dud31
@Random_dud31 Жыл бұрын
Its still hard to believe that in the end, its all just 0s and 1s
@shanez1215
@shanez1215 Жыл бұрын
The E cores actually aren't more power efficient clock for clock as the P cores. The E is more about die area efficiency than power efficiency. Intel is fitting 4 E cores in the same physical space as one E core. Since each E core is ~40% of a P core, you come out ahead if they're utilized well.
@Frozoken
@Frozoken 11 ай бұрын
Ur right in the fact that they main goal is multithreading performance like a traditionally named mid core on mobile but they are also more efficient power wise. I find that roughly 4 ecores and a single non hyper threaded p core use the same power. Absolutely more power efficient obviously. Not to mention that ecores perform much better performance and power wise when using 1/4 of the cluster like how it would actually typically be used. One reason for this and theres many more complex ones too is that one ecore can use all the cluster's l2 cache for itself while all 4 have to share that same bandwidth plummeting ipc. Chips and cheese showed this. Oh yeah and it seems windows knows too, when playing games in my 13600k my very first and very last ecore have massively more utilisation consistently
@1year1meme84
@1year1meme84 Жыл бұрын
Cool video, but Linus mentions Windows all the time during the video. If I'm not mistaken, these mechanics happen for every operating system
@milind8751
@milind8751 Жыл бұрын
Correct me if I'm wrong but isn't context switching the process of saving/restoring the state of a process/thread so that it can be paused or later resumed?
@wassimajili5983
@wassimajili5983 Жыл бұрын
We can see linus in more videos now, the new CEO is the best thing that has happened to LTT since forever
@bgezal
@bgezal Жыл бұрын
CPU context switching is like changing the load in your washing machine mid laundry.
@deldarel
@deldarel Жыл бұрын
"but is that how your cpu works?" Me, a python developer: "yes"
@BrianG61UK
@BrianG61UK Жыл бұрын
I think multithreaded Python is a thing now. But even ignoring that, he goes straight on to say a core can switch from running one thread to running another one.
@mufeedtalukder4556
@mufeedtalukder4556 Жыл бұрын
The Windows logo really be like: 👁️ 👄 👁️
@imacgra1
@imacgra1 Жыл бұрын
To save on your electricity bill, and to save the planet 3:58
@ThunderBlastvideo
@ThunderBlastvideo Жыл бұрын
ive ALWAYS wanted to know this! thanks!
@HuntersOA
@HuntersOA Жыл бұрын
This with thread priority is the bane of our existence at work :D We use windows based machines for test systems as our IT does not allow linux or other. The microsoft scheduler has a really weird approach to things - and on of them is that they always have "user experience" at the top. So mouse movement, etc. For us, this often causes that Windows does not get the data out of the network cards buffer "fast enough". In time sensitive applications - such as communication with a measurement device, this sometimes causes the communication to brake down :D And we have not yet found a suitable workaround for this other then giving the systems more "timeouts" to account for windows scheduling...
@HuntersOA
@HuntersOA Жыл бұрын
@@breaddough-vk8gf not our softwarw is the problematic. The network card recieves the data packets, but windows scheduler does not read them out. Unfortunately it has little to do with our software :D
@HuntersOA
@HuntersOA Жыл бұрын
@@breaddough-vk8gf The issue is with TCP its self - the data packets arrive and are confirmed, however, they are not read out from the pcie gigabit card in time :D Thus our software can not prepare the proper responses to the sending device. Funny gummy. Do not use regular windows for measurement systems :)
@HuntersOA
@HuntersOA Жыл бұрын
@@breaddough-vk8gf the thing is, they are not dropped :D The control is event driven and packets get into a fifo. Windows does not read out the packets from the card for up to 300ms - while we expect loop cycle times under 20ms. This means by the time the packet gets to our code it is obsolete for the HW connected on TCP and the communication brakes down. No packet was lost, but the delay causes an async behaviour which results in errors as time stemps are "too old" :D The thing is, this is because user experience is above all else. If you game or something, this does not happen. Of you have a measurement system - and a test is running. Than the operator opens a PDF -> you get this :D Also it is attrocious if xou connect via RDP, than it can be a skip of 2-3 seconds :D RDP really messes windows up
@RobertForslund
@RobertForslund Жыл бұрын
I have no problem believing that the one person who could actually multitask, it would be Yvonne! 😁👍
@eemanemm
@eemanemm Жыл бұрын
Would be nice to see also from Linux perspective if it does scheduling similar to Windows or not. It may be interesting perhaps?
@ChristopherHailey
@ChristopherHailey Жыл бұрын
Linux actually has many different schedulers, each with pros and cons.
@eemanemm
@eemanemm Жыл бұрын
Christopher Hailey thanks I'm well aware. They could have picked the default, which ships with Ubuntu and / or SteamOS. Again, would have made things more interesting.
@BrianG61UK
@BrianG61UK Жыл бұрын
I wouldn't have thought there would be any difference at the relatively simple ShortCircuit level of detail.
@ChristopherHailey
@ChristopherHailey Жыл бұрын
Ubuntu ships with around 8 schedulers, it's real rabbit hole of a topic. I think queuing theory is beyond a quicky, but I see what you're saying
@srobak
@srobak Жыл бұрын
the graphics and animations on this one are frakkin hysterical...
@SAl-sg8gt
@SAl-sg8gt Жыл бұрын
where was this videos 4 years ago when i was "learning" data structures class
@monoklmen
@monoklmen Жыл бұрын
25 seconds in and I am already smashin the like button. What a goofy CPU avatar, love it.
@MetalMan1245
@MetalMan1245 Жыл бұрын
I love how they just inexplicably used the Tea cooled PC as a demonstration for no particular reason and I love it.
@tamertamertamer4874
@tamertamertamer4874 Жыл бұрын
Hello programmers ! Make sure to use locks when you make threads that share the same variables ! You don’t want any race conditions :)
@QueenSaffryn
@QueenSaffryn Жыл бұрын
I can't wait for the next Fast As Techquickie video :)
@hovant6666
@hovant6666 Жыл бұрын
those were some creepy animations m8
@ChiefKapui
@ChiefKapui 8 күн бұрын
Why blockchains can't scale, they're limited to the sequential ordering of blocks one after another, like my brain🥴
@Tofu3435
@Tofu3435 Жыл бұрын
It is interesting how Windows95 managed multitasking with a 1 core 386cpu in the 90s, nowadays even the cheapest budget android tablets have 8 core soc.
@m.anejante1687
@m.anejante1687 Жыл бұрын
why that crankshaft has some rods circling one way and others in the opposite? is that some kind of new magical crankshaft?
@m.junaidmahmood4209
@m.junaidmahmood4209 Жыл бұрын
If you really want to start learning how CPU's work and how to code for them on a lower level read the book "Assembly Language Programming and Organization of the IBM PC" by Prof Ytha Yu. Its an old book but it is the fundamentals to start with.
@jamtea388
@jamtea388 Жыл бұрын
Thanks for this video! For whoever is doing the canned content inserts, I think it is nicer to just look at the speakers face.
@lordraiden007
@lordraiden007 Жыл бұрын
Ummmm, small thing, in windows the highest priority is “real time” followed by 0, then 1, etc., then 10. A higher number indicates lower priority.
@itsdeonlol
@itsdeonlol Жыл бұрын
This is why Windows Scheduler is important!
@riednknight485
@riednknight485 Жыл бұрын
Man at this point computers feel less like a science but more like a voodo thingy.
@adventureoflinkmk2
@adventureoflinkmk2 Жыл бұрын
0:14 so thats how queries work in computers.. based in software. I thought for the most part it was hardware
@RealCoderCrafter
@RealCoderCrafter Жыл бұрын
2:22 chad move
@dvilardi
@dvilardi Жыл бұрын
0:35 “we’d like to thank our friends at intel for their assistance” | 2:25 “here’s an AMD”
@KJ4EZJ
@KJ4EZJ Жыл бұрын
Others have talked about context switching, but the description of libraries stuck out to me. While there are libraries that serve that purpose, that is not the definition of a library. Most libraries do not run in a separate thread by default. Almost none do. Take, for example, nodeJS. The focus on Windows is also disappointing. I get most people use it, but it is quite the black box. Linux is much more interesting to study if you want to go this deep.
Why CPU GHz Doesn’t Matter!
10:25
Linus Tech Tips
Рет қаралды 3,2 МЛН
Bad Value PC Parts Everyone Loves
6:48
Techquickie
Рет қаралды 195 М.
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 6 МЛН
The day of the sea 😂 #shorts by Leisi Crazy
00:22
Leisi Crazy
Рет қаралды 1,2 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 21 МЛН
CPU vs GPU vs TPU vs DPU vs QPU
8:25
Fireship
Рет қаралды 1,7 МЛН
How Do CPUs Use Multiple Cores?
6:00
Techquickie
Рет қаралды 2 МЛН
Confusing Symbols on SD Cards
5:20
Techquickie
Рет қаралды 521 М.
Every AMD CPU Ever!
8:31
Techquickie
Рет қаралды 753 М.
20+ Windows features you didn’t know about
16:17
Linus Tech Tips
Рет қаралды 2,5 МЛН
When you Accidentally Compromise every CPU on Earth
15:59
Daniel Boctor
Рет қаралды 823 М.
The Dumbest Connectors Ever
6:36
Techquickie
Рет қаралды 1,3 МЛН
What If You Pull Your CPU Out While The PC Is On?
6:54
Techquickie
Рет қаралды 517 М.
How are Microchips Made? 🖥️🛠️ CPU Manufacturing Process Steps
27:48
Motherboard Default settings could be COOKING your CPU!
15:33
JayzTwoCents
Рет қаралды 1,1 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 6 МЛН