How CPUs Use Multiple Cores
0 up · 0 down · 0 ratings
Promos
Check out the new Logitech MX Anywhere 3S Mouse and MX Keys S wireless keyboard at Best Buy through the links below. Save 20% with purchase of a computer, laptop, monitor or tablet. Offer ends June 30th. Logitech MX Anywhere 3S Mouse at Best Buy: lmg.gg Logitech MX Keys S at Best Buy: lmg.gg Purchases made through some store links may provide some compensation to Linus Media Group. Learn how CPU scheduling works and it helps them juggle multiple tasks and use multiple cores. Leave a reply with your requests for future episodes. ► GET MERCH: lttstore.com ► LTX 2023 TICKETS AVAILABLE NOW: lmg.gg ► GET EXCLUSIVE CONTENT ON FLOATPLANE: lmg.gg ► SPONSORS, AFFILIATES, AND PARTNERS: lmg.gg FOLLOW US ELSEWHERE --------------------------------------------------- Twitter: twitter.com Facebook: @LinusTech Instagram: @linustech TikTok: @linustech Twitch: twitch.tv
The video explains that CPUs do not simply multitask by switching attention rapidly between tasks. Instead, modern CPUs rely on an operating system scheduling mechanism that decides which set of instructions or threads gets to use the processor first. The presenter introduces key concepts such as thread priority, which apps can set and the OS can adjust based on resource needs and instruction types. He also discusses quality of service, or qos, as another signal used by developers to indicate how much processing power a thread may require. QoS plays a role in power management, allowing the OS and hardware to coordinate frequency scaling within power constraints, which is especially important for laptops. The discussion then moves to older single-core behavior versus the realities of multi-core and hybrid architectures, including big cores for performance and smaller efficiency cores. The video explains that what matters is minimizing unnecessary context switches and ensuring threads start and finish on a single core whenever possible to balance load. Libraries and runtime systems are highlighted as ways to help developers write multi-threaded code without excessive manual core management. The segment also covers newer chip designs with hybrid cores, such as performance cores and efficiency cores, and how schedulers may route workloads to the most suitable core. Finally, hardware-assisted features that advise the operating system on which core to use are introduced, showing how scheduling decisions now involve both software and hardware cooperation to maximize performance or conserve power. The overall takeaway is that multi-core scheduling is a complex, evolving collaboration between the OS, applications, and processor hardware to efficiently juggle multiple tasks at once.
Topics · computing · computer-hardware · multithreading · cpu-architecture
Questions answered
- What is the role of thread priority in CPU scheduling?
- Thread priority determines the order in which the OS schedules threads for CPU time, with higher priority threads getting processed earlier than lower priority ones.
- What is quality of service (qos) in threading, and how does it affect scheduling?
- Quality of service is a developer-provided signal that indicates how much processor power a thread may need; the OS uses qos alongside priority to make scheduling decisions and manage power use.
- How do hybrid CPUs with p-cores and e-cores influence scheduling?
- Scheduling can prefer performance cores for demanding tasks and may assign additional threads to efficiency cores when appropriate, with the OS and hardware working together to balance performance and power use.
- What is context switching and how does it relate to core assignment?
- Context switching is the OS switching which task is running on a core, while thread migration moves a thread between cores; both affect performance but involve different mechanisms.