|
Home > Archive > Unix Programming > July 2005 > Process-1 writes data into Shared memory; It crashes; Can process-2 later read that da
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Process-1 writes data into Shared memory; It crashes; Can process-2 later read that da
|
|
| qazmlp1209@rediffmail.com 2005-07-28, 2:51 am |
| One basic question on 'Shared Memory':
One process has written some data onto the shared memory. After that,
the process crashes due to some fault. Can someother process later read
that data? In my understanding, it should still be available until the
process who owns that segment explicitly detaches it. Am I right? Can
somebody clarify this?
| |
| maxim.yegorushkin@gmail.com 2005-07-28, 7:50 am |
| qazmlp1209@rediffmail.com wrote:
> One basic question on 'Shared Memory':
> One process has written some data onto the shared memory. After that,
> the process crashes due to some fault. Can someother process later read
> that data? In my understanding, it should still be available until the
> process who owns that segment explicitly detaches it. Am I right? Can
> somebody clarify this?
Shared memory, as well as message queues and semaphores, has kernel
persistence. This means, unless its public name is unlink()ed, it lasts
till the kernel lives. Note that one can create shared memory without a
public name.
In one VoIP router we used shared memory for storing Call Details
Records (CDRs). If for some weird reason the server crashed a new
server would reopen the shared memory, finilize CDRs and dump them to a
database.
|
|
|
|
|