Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::shared::memory consistency
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-12-29 17:52:38


El 29/12/2011 14:49, Josmon Paul escribió:
> Hi All
> I have a doubt regarding boost shared memory. If i am reading data from
> my shared memory and in between if some other program deletes or
> overwrites the same shared memory then how it will affect the reading.
> Will it throw segmentation fault ? I am expecting a segmentation fault
> but when i wrote a small program to read the memory and in the same time
> i deleted the same memory through another program using the function
> (shared_memory_object::remove ()) the behavior is like, it gave the
> content which was already present in the old shared memory and exited
> without segmentation fault. I would be verymuch grateful if someone
> tells the exact behavior in this situation

POSIX semantics: just like a UNIX unlink call when anotherprocess is
reading a file. The already attached program continues using the old
file. the file is destroyed when the last attached program closes the
file/shm.

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