4 ms·
What do you swap into the pointer? A new instance?
by limmeau 13y ago
What do you swap into the pointer? A new instance?
- vy8vWJlco 13y agoIf the pointer is 0 through a normal test, you would allocate the resource and do a compare-and-swap to record the allocation if the pointer is still 0. As noted beside this comment, you might wind up allocating several times in parallel (which may be undesirable too), but you would never clobber an existing allocation or change the instance that is dispensed.