Re: Shared Memory in Windows [message #48225 is a reply to message #48224] |
Wed, 05 April 2006 15:11   |
Marc Reinig
Messages: 30 Registered: June 2004
|
Member |
|
|
> ... shared
> memory appears to be backed in the pagefile. Does that mean that I will
> have overhead due to disk IO? Or is the pagefile actually backed in RAM
> and only uses pagefile.sys when RAM is exhausted.
The second is correct. All user RAM can be swapped out during its life.
Therefore it when it is swapped out it must exist somewhere permanent so it
can be restored and brought back into RAM.
If you create a shared memory region, which is not based on an existing
file, it will be backed by the swapfile when that portion of the user's
memory is swapped out.
If it is based on a real file, when the memory is 'swapped out', the file
itself becomes the backing store.
There is no overhead until and unless it is swapped.
Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics
"Robbie" <retsil@iinet.net.au> wrote in message
news:1144197125.106190.289860@v46g2000cwv.googlegroups.com.. .
>
> Just a simple performance question for shared memory in Windows...
>
> I've started aquainting myself with POSIX and SYSV shared memory in
> UNIX and I was looking for a Windows equivalent. To my dismay shared
> memory appears to be backed in the pagefile. Does that mean that I will
> have overhead due to disk IO? Or is the pagefile actually backed in RAM
> and only uses pagefile.sys when RAM is exhausted.
>
> ------------------------------------------------------------ ------------------------------------------------------------ --------------------------
>
>> From IDLs SHMMAP documentation
>
> Under Microsoft Windows, the CreateFileMapping() system call forms the
> basis for shared memory as well as memory mapped files ... To create a
> region of anonymous mapped memory instead of a mapped file, you pass a
> special file handle (0xffffffff) to CreateFileMapping(). In this case,
> the disk space used to back the shared memory is taken from the system
> pagefile.
>
> ------------------------------------------------------------ ------------------------------------------------------------ --------------------------
>
>> From the MSVC documentation for CreateFileMapping()
>
> .... In this case, CreateFileMapping creates a file mapping object of
> the specified size backed by the operating-system paging file rather
> than by a named file in the file system.
>
> ------------------------------------------------------------ ------------------------------------------------------------ --------------------------
>
> Thanks,
> Robbie
>
|
|
|