Damon's Blog
The magic you are looking for is in the work you're avoiding.
Gems
2026
January
Compiling in debug mode will then include debug symbols (-g), disable optimisation (-00), and enable assert() by omitting -DNDEBUG.
在读操作占主导时,Wait-Free 表现极佳。因为读线程的“协助”行为分散了写线程的竞争压力,而且读操作本身不需要像 CAS 循环那样反复争抢缓存行。
但在写操作占主导时,Lock-Free 反而更快。为什么?因为 Wait-Free 的那些位运算、状态判断、原子交换握手,都是实打实的 CPU 指令开销。而 Lock-Free 在竞争不激烈的时候,就是一个简单的原子加减,极其轻量。
TODO
1: Transforming Uniform Random Variables to Normal
Central Limit Theorem (CLT) Method (12 Uniforms): Generate Gaussian samples by central limit theorem
Inverse Transform Sampling: How to generate Gaussian samples
Box-Muller Transform: Box-Muller
Beasley-Springer-Moro Algorithm
linear congruential generator
Transforming Uniform Random Variables to Normal
Box-Muller Transform
Beasley-Springer-Moro Algorithm
Inverse Transform Method
Contacts

Last updated