My confusion is do I have to define the count variable as atomic type or a normal int would do, if I want to get the correct count for the frequency of the upsert function call.
Basically, if the order of the upsert function call doesn't matter to me then does the .upsert function serialize the update/initialization(you can imagine two initialization call concurrently) call to avoid race condition inside the TGValue object? It's not very clear from the documentation.
Hi, check the following piece of code from here.
My confusion is do I have to define the count variable as.upsert function serialize the update/initialization(you can imagine two initialization call concurrently) call to avoid race condition inside the
atomic
type or a normal int would do, if I want to get the correct count for the frequency of the upsert function call. Basically, if the order of the upsert function call doesn't matter to me then does theTGValue
object? It's not very clear from the documentation.