Re: 2 questions about memory mapped files



The only guarantee we have is an engineering one - we can only expect it it will behave that way. :-)

Alexander Grigoriev wrote:

Does cache manager guarantee that the pages are flushed for a remote file, when a logon session is being closed (an user logs out)?

"Pavel Lebedinsky [MSFT]" <pavel@xxxxxxxxxxxxxxxxxxxx> wrote in message news:%23K76VCbwKHA.4636@xxxxxxxxxxxxxxxxxxxxxxx
But in any case, the data is flushed when the file mapping object is ultimately closed.
There are two ways a modified mapped page can be written to disk:

1. As a result of an explicit FlushViewOfFile call.

2. After a page has been trimmed or unmapped from all working sets,
the mapped page writer thread will (eventually) write it to disk.
The OS makes no guarantees as to how long this will take, but
eventally all such pages will be written to their backing storage,
unless the system crashes or loses power, or the backing storage
becomes unavailable (e.g. network is disconnected).

Closing the file mapping object has no effect on when the pages will
be written out.

--
Pavel Lebedinsky/Windows Fundamentals Test
This posting is provided "AS IS" with no warranties, and confers no rights.






--
HLS
.