why do we return the "current_value" regardless of whether or not we reset the value at "location"? Wouldn't we want to return the value at "location" if we updated it?
@leakaufmann9500 Жыл бұрын
I think that the returned value is used to check that the CAS operation succeeded (current_value == old_value).
@oladipotimothy60072 жыл бұрын
Nice approach
@chronewhite41972 жыл бұрын
I need more explanation, because I don't have much knowledge How is CAS atomic? There are multiple operations in the title itself - read, compare and set new value
@sas1one6 ай бұрын
At hardware level (Intel CPU) there is an atomic instruction for the compare-and-exchange operation. INSTRUCTION SET REFERENCE, A-L, 3-208 Vol. 2A "CMPXCHG-Compare and Exchange" part of Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2 (2A, 2B, 2C, & 2D): Instruction Set Reference, A-Z.
@kkiranayb4 жыл бұрын
Is data structures finished here ???? Sir
@pdaae6 жыл бұрын
thanks!
@shivangisingh26434 жыл бұрын
my whole attention was on how this amazing person is writing backwards/mirrored (whatever it is called). Good explanation though.
@kumarprakash82604 жыл бұрын
He's not🤣
@ericfricke45123 жыл бұрын
He writes forwards facing us, and then it is mirrored in processing afterwards to compensate.