Boost logo

Boost :

Subject: Re: [boost] [interprocess] native Windows cond_var + mutex
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-10-30 15:25:17


El 30/10/2011 15:34, Dan Brown escribió:

> Now that I understand the lifetime that applies to (file-like) named
> objects issue a little better I'm still unsure of why it matters.
> Why does it matter (other than performance) if on Windows, the object
> happens to be deleted when the last reference goes away? The
> "explicit destroy" operation is then a noop on Windows. When it is
> referenced again it is recreated. There must be some use case that
> is not occurring to me right now.

Yes, because in UNIX a process could create a named semaphore / shared
memory (which is a named resource), increase / write it, exit and then
another process could get those counts/memory. It's a widely used
pattern in some environments. In windows, when the creator exits, as it
was the only attached process, the mutex/memory would be automatically
destroyed and no new process could get access to it.


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