|
|
|
|
|
by voidnullnil
1816 days ago
|
|
> This "Memory Model" discussion is only for people who want to build faster systems: for people searching for a "better spinlock", or for writing lock-free algorithms / lock-free data structures. Actually, most practitioner code has bugs from their implicit assumptions that shared variable writes are visible or ordered the way they think they are. |
|
To solve that problem, the practitioner only needs to know that "mutex.lock()" and "mutex.unlock()" orders reads/writes in a clearly defined manner. If the practitioner is wondering about the difference between load-acquire and load-relaxed, they've probably gone too deep.