Linux Kernel Spinlock Implementation with Interrupt State Management
In Linux kernel development, spinlocks are essential synchronization primitives for protecting shared resources in interrupt contexts. This article demonstrates how to implement interrupt-safe spinlocks in a character device driver for controlling GPIO-based LEDs. We'll explore the use of spinlock functions that save and restore interrupt state ...
Posted on Mon, 28 Sep 2026 16:38:52 +0000 by Thunderfunk
Implementing Spinlocks with C++11 atomic_flag
Understanding atomic_flag
The atomic_flag is the simplest atomic boolean type in C++11's <atomic> header, supporting only two operations: test_and_set and clear.
Constructor and Initialization
atomic_flag() noexcept = default;
atomic_flag(const atomic_flag&) = delete;
atomic_flag has only a default constructor. Copy construction is d ...
Posted on Wed, 09 Sep 2026 16:07:04 +0000 by RestlessThoughts