[interprocess] construct<> and find_or_construct<>

Are construct<> and find_or_construct<> self-synchronized? For instance, can several process do the following seg.find_construct<type>("name"); (same seg, type and name) without guarding the operation with a mutex? Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

JOAQUIN LOPEZ MU?Z wrote:
Are construct<> and find_or_construct<> self-synchronized? For instance, can several process do the following
seg.find_construct<type>("name");
(same seg, type and name) without guarding the operation with a mutex?
Yes, all those functions are synchronized with a recursive mutex, so that the constructor of the object can use construct<> again to construct more named objects. This is (vaguely) explained here: http://cloud.prohosting.com/newfunk/boost/libs/interprocess/ doc/html/interprocess/managed_memory_segment_features.html Regards, Ion

Ion Gaztañaga ha escrito:
JOAQUIN LOPEZ MU?Z wrote:
Are construct<> and find_or_construct<> self-synchronized? For instance, can several process do the following
seg.find_construct<type>("name");
(same seg, type and name) without guarding the operation with a mutex?
Yes, all those functions are synchronized with a recursive mutex, so that the constructor of the object can use construct<> again to construct more named objects. This is (vaguely) explained here:
http://cloud.prohosting.com/newfunk/boost/libs/interprocess/ doc/html/interprocess/managed_memory_segment_features.html
Thanks for the info! Best, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (3)
-
"JOAQUIN LOPEZ MU?Z"
-
Ion Gaztañaga
-
Joaquín Mª López Muñoz