|
|
|
|
|
by dwohnitmok
1541 days ago
|
|
Not necessarily. Depends on the underlying hardware implementation (with different answers for e.g. x86 vs ARM) since software CAS usually is implemented as a single CPU instruction. This is also stretching the definition of "lock" quite a bit because usually CAS is used to implement lock-free and wait-free concurrency. But regardless at most, even in hardware, it's a single top-level lock, and sometimes not even that. Not one along every level of a data structure. |
|