Boost Users :
Subject: Re: [Boost-users] multi_index: thread safety
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-03-08 11:06:57
Matwey V. Kornilov <matwey.kornilov <at> gmail.com> writes:
> I have a multi_index container and would like to make concurrent READs.
> Is it thread-safe? I mean that there could be mutable members inside the
> object, so calling formally const functions leaded to concurrent writes.
Adding to Ernest's answer: if your formally const function changes the
value of some mutable data member, then concurrent access is NOT safe.
mutable std::size_t count;
Concurrent execution of X::get_x is not safe. This has nothing to do
with Boost.MultiIndex, by the way; if your problem is different please
JoaquÃn M LÃ³pez MuÃ±oz
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net