Boost logo

Boost Users :

Subject: Re: [Boost-users] [interprocesss] managed_mapped_file mutex question
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2010-03-18 21:43:03


El 18/03/2010 16:55, Andy Wiese escribió:
> Many processes will both read and write this index map. Do the
> interprocess:: containers provide the needed synchronization, or do I
> need other synchronization mechanisms?

You need to provide them. Interprocess memory allocation (via
construct<>, or allocate(), or through allocators) is thread-safe, just
like ::new is thread safe for inter-thread programming. But similarly to
inter-thread programming interprocess::map offers the same guarantees as
std::map, because interprocess containers are standard-conforming
containers: you must provide your own synchronization if you use the
same object by two processes-theads and one is inserting or erasing
elements.

Best,

Ion


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