Changes

Jump to: navigation, search

Atomic Operation

348 bytes added, 08:08, 15 July 2014
no edit summary
GCC provides [[Compiler Intrinsics|intrinsics]] for some atomic operations.
 
(Note that in the above example, even the <code>lock++</code> instructions may not be atomic - it will typically compile into the three-operation sequence "load-increment-store", and its possible that two processes or threads could each perform this operation in an interleaved fashion and increment <code>lock</code> by just one instead of two).

Navigation menu