# Linux Kernel Module Cheat

#### 29.14.1. x86 LOCK prefix

Inline assembly example at: userland/cpp/atomic/x86_64_lock_inc.cpp, see also: atomic.cpp.

Ensures that memory modifications are visible across all CPUs, which is fundamental for thread synchronization.

Apparently already automatically implied by some of the x86 exchange instructions

Bibliography:

- https://stackoverflow.com/questions/8891067/what-does-the-lock-instruction-mean-in-x86-assembly/56803909#56803909

- https://stackoverflow.com/questions/980999/what-does-multicore-assembly-language-look-like/33651438#33651438