Subject: Re: [boost] boost atomic question
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-04-30 12:44:58
Edouard A. wrote:
> Actually you will only add problems if you do that. You need to use a
> concurrent container, not a classical containers with atomics variables.
If you do nothing but mutate the stored objects, then it should be fine
without a concurrent container.
> First, atomic is more expensive than you think, to convince yourself of
> this, benchmark the two following codes:
> int i = 0;
> while(i < 10 * 1000 * 1000) ++i;
Will probably be optimized to nothing, so it's not really a good example.