Tagged articles

context switch

16 articles · Page 1 of 1
Java Architect Handbook
Java Architect Handbook
Aug 25, 2026 · Fundamentals

What Is a Time Slice? A Quick Interview Question Explained

The article defines a time slice (time quantum) as the fixed CPU interval allocated to each ready process in a time‑sharing scheduler, explains its role in round‑robin and CFS algorithms, discusses size trade‑offs, Linux implementation details, context‑switch costs, and typical interview follow‑up questions.

CFSOS schedulingcontext switch
0 likes · 9 min read
What Is a Time Slice? A Quick Interview Question Explained
Deepin Linux
Deepin Linux
Jul 25, 2026 · Fundamentals

Why System Calls Can Kill Performance and How to Cut Them

The article explains how frequent Linux system calls cause costly context switches, kernel checks, and cache/TLB invalidations, presents benchmark code that quantifies the overhead of getpid, open, read, and demonstrates batch I/O, caching, and algorithmic techniques to dramatically reduce those calls and boost high‑performance C++ network services.

CachingI/O batchingLinux
0 likes · 28 min read
Why System Calls Can Kill Performance and How to Cut Them
Deepin Linux
Deepin Linux
Apr 18, 2026 · Fundamentals

Mastering Process Context Switching: What the CPU Actually Does

This article breaks down the fundamentals of process context switching, explaining CPU registers, program counters, the three-step switch routine, trigger conditions, performance impact, monitoring tools, and practical optimization techniques to help interview candidates answer confidently.

LinuxPerformance Optimizationcontext switch
0 likes · 29 min read
Mastering Process Context Switching: What the CPU Actually Does
FunTester
FunTester
Feb 26, 2026 · Backend Development

Why Waiting, Not Computing, Dominates Tail Latency in High‑Concurrency Systems

In high‑concurrency systems, tail latency is driven primarily by waiting on locks, resources, and scheduling rather than raw computation, with phenomena like head‑of‑line blocking, context‑switch overhead, and cache‑coherency costs amplifying unpredictable delays.

Tail Latencybackend systemscontext switch
0 likes · 13 min read
Why Waiting, Not Computing, Dominates Tail Latency in High‑Concurrency Systems
Liangxu Linux
Liangxu Linux
Nov 22, 2023 · Operations

How to Diagnose High Context Switches on Linux with vmstat and pidstat

This guide explains what system context switches are, how to monitor them using vmstat and pidstat, provides a practical stress‑ng example that spikes switches, breaks down kernel thread kworker/u256:29-flush-8:0, and clarifies the difference between voluntary and non‑voluntary switches to help troubleshoot performance issues.

Performance Monitoringcontext switchpidstat
0 likes · 12 min read
How to Diagnose High Context Switches on Linux with vmstat and pidstat
Liangxu Linux
Liangxu Linux
Aug 24, 2022 · Operations

How to Diagnose and Fix High CPU Context Switches on Linux

This guide explains what CPU context switches are, how to monitor them with vmstat and pidstat, analyzes a sysbench‑generated load case, examines interrupt sources, and provides practical thresholds and troubleshooting steps to improve Linux system performance.

CPULinuxPerformance
0 likes · 10 min read
How to Diagnose and Fix High CPU Context Switches on Linux
Liangxu Linux
Liangxu Linux
May 15, 2022 · Fundamentals

Why Linux CPU Context Switches Slow Your System and How They Work

Linux’s multitasking illusion relies on CPU context switches, where the kernel saves and restores registers and program counters for processes, threads, and interrupts, and understanding these mechanisms—including their types, performance costs, and scheduling triggers—reveals why excessive switches can degrade system performance.

CPUPerformancecontext switch
0 likes · 11 min read
Why Linux CPU Context Switches Slow Your System and How They Work
MaGe Linux Operations
MaGe Linux Operations
Apr 22, 2022 · Fundamentals

Understanding Linux CPU Context Switches: Impact and Mechanics

This article explains how Linux creates the illusion of multitasking by rapidly swapping CPU registers and program counters, details the three types of context switches—process, thread, and interrupt—and shows why excessive switching can significantly degrade system performance.

Linuxcontext switchprocess
0 likes · 10 min read
Understanding Linux CPU Context Switches: Impact and Mechanics
Tencent Cloud Developer
Tencent Cloud Developer
Mar 10, 2022 · Fundamentals

How to Build a Stackful C++ Coroutine from Scratch: Deep Dive into Context Switching

This article provides a step‑by‑step technical guide to implementing C++ stackful coroutines, covering the design of the owl.context API, low‑level context‑switch principles, register saving conventions on 32‑bit ARM, and complete source code for co_getcontext, co_setcontext, co_swapcontext and co_makecontext with illustrative examples and diagrams.

ARMC++Low-Level Programming
0 likes · 15 min read
How to Build a Stackful C++ Coroutine from Scratch: Deep Dive into Context Switching
Liangxu Linux
Liangxu Linux
Jun 16, 2021 · Fundamentals

Understanding Linux Scheduler: Structures, Policies, and Context Switch Mechanics

Learn how Linux selects the next process for CPU execution by exploring key scheduler structures such as task_struct, sched_class, runqueue, the various scheduling policies (CFS, RT, Deadline, etc.), the scheduling flow, and the low‑level context_switch mechanism that swaps address spaces and registers.

CFSLinuxcontext switch
0 likes · 8 min read
Understanding Linux Scheduler: Structures, Policies, and Context Switch Mechanics
Liangxu Linux
Liangxu Linux
Dec 1, 2020 · Fundamentals

How Much CPU Time Does a Linux Context Switch Really Cost?

This article measures the CPU time consumed by Linux process and thread context switches, explains the underlying operations, compares simple token‑passing tests with lmbench benchmarks, and shows how to monitor and interpret switch statistics on a production server.

BenchmarkLinuxPerformance
0 likes · 13 min read
How Much CPU Time Does a Linux Context Switch Really Cost?
Qunar Tech Salon
Qunar Tech Salon
Aug 1, 2017 · Databases

MySQL Time Zone Setting Causes High CPU and Slow Queries Due to Mutex Contention

A production MySQL incident showed sudden system CPU spikes and many running threads despite low query throughput, which was traced to the server's time_zone=system setting causing timestamp conversion to lock a global mutex, leading to excessive spin‑locks, context switches, and degraded performance that was resolved by changing the time_zone to a fixed offset.

CPUMySQLPerformance
0 likes · 6 min read
MySQL Time Zone Setting Causes High CPU and Slow Queries Due to Mutex Contention