Boost logo

Boost :

From: Paul Poulin (ppoulin_at_[hidden])
Date: 2007-04-13 17:06:32


Interprocess, shared memory, bug & patch.

 

Bug: A race condition exists if a shared memory segment is being
created/initialized for the first time. Another attempt to open the shared
memory segment concurrently results in the second process waiting for the
creator to complete the initialization. When the initialization is
complete the second attempt will promptly throw an interprocess_exception
(corrupted_error).

 

Fix: The patch solution is to wait for the memory segment to not be in the
InitializingSegment or UninitializedSegment states. At this point if the
state is anything other than InitializedSegment then throw the
interprocess_exception.

 

A proposed patch is attached.




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk