CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    9

    memory map with multiple handles - Can we use multiple handles to memory map a file ?

    In a process is good decision to use multiple memory maps with different file handles?

    Currently we are using single file handle with multiple memory maps . Since it is single handle we are using synchronization lock across the threads while reading file using memory maps.

    With the new approach of different handles we will avoid the lock and trying to get the performance benefit out of this

    However would like to know how the Virtual memory manager behaves when i use different handles.

    Will this acts concurrently and read the data ?
    (or)

    Though am using different handles since the file is same it behaves sequential and no performance benefit?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,494

    Re: memory map with multiple handles - Can we use multiple handles to memory map a fi

    Why not test to see if separate file handles offer any benefits? Also, have you tried to use the page file backed memory mapped file (i.e. no physical file) by passing NULL as the file handle?

  3. #3
    Join Date
    May 2008
    Posts
    9

    Re: memory map with multiple handles - Can we use multiple handles to memory map a fi

    Hi Arjay Thanks for the reply
    we are trying the sample application to see the advantage of multiple handles.
    However wanted to know how the VMM (memory manager) seeks the data when i say different memory maps of a same file using different handles ?
    does it support concurrency and reads the data ? if yes we will get benefit out of this approach else we may not get benefit if VMM(Virtual Memory Manager) is bottleneck though am using different handles now

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,494

    Re: memory map with multiple handles - Can we use multiple handles to memory map a fi

    I don't believe the vmm provides any sychronization (at least I don't recall ever reading anything that implies it does). Again, I would suggest that you test for it.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured