Arachne
Arachne copied to clipboard
Is it necessary to use cmpxchg when clear a bit of MaskAndCount?
Hi,
Quick question about MaskAndCount.
It could be read by multiple threads concurrently, thus a final compare_and_swap is necessary to guarantee atomicity.
But is it only being cleared by one single thread (the one who owns it)? If so, it seems a simple atomic clear_bit() is enough rather than full-fledged cmpxchg. Related code here.