Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-09-15 04:31:32


Phil Endecott wrote:
> Any ideas when the write-back occurs? When the file is closed /
> unmapped? Can you call flush to force write back? (Does interprocess
> support any of this?)

Interprocess uses OS dependent functions. For example, FlushViewOfFile
for Windows states (http://msdn2.microsoft.com/en-us/library/aa366563.aspx):

"When flushing a memory-mapped file over a network, FlushViewOfFile
guarantees that the data has been written from the local computer, but
not that the data resides on the remote computer. The server can cache
the data on the remote side. Therefore, FlushViewOfFile can return
before the data has been physically written to disk. However, you can
cause FlushViewOfFile to return only when the physical write is complete
by specifying the FILE_FLAG_WRITE_THROUGH flag when you open the file
with the CreateFile function."

The flag FILE_FLAG_WRITE_THROUGH is not used for performance reasons, so
synchronization is not guaranteed.

> Anyway, I think the answer is that this is either hard or impossible;
> but I thought I'd ask just in case someone has already investigated.

I'm afraid you are right :-(

Regards,

Ion


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