Are sharing a memory-mapped file and sharing a memory region implemented based on each other?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seems to me that it is a chicken-egg problem.



Operating System Concepts introduces sharing a memory-mapped file in the following.
Do the multiple processes share the same file by sharing the same physical memory region holding the content of the file?




Multiple processes may be allowed to map the same file concurrently,
to allow sharing of data. Writes by any of the processes modify the data in
virtual memory and can be seen by all others that map the same section of
the file. Given our earlier discussions of virtual memory, it should be clear
how the sharing of memory-mapped sections of memory is implemented:
the virtual memory map of each sharing process points to the same page of
physical memory—the page that holds a copy of the disk block.
This memory
sharing is illustrated in Figure 9.22.



enter image description here




It also introduces shared memory in the following.



  • Do multiple processes share a memory region by sharing a memory-mapped file?


  • Does a "memory-mapped file" reside on disk or main memory? I think it is on the disk, but "The memory-mapped file serves as the region of shared
    memory between the communicating processes" seems to mean that it resides in main memory.



Quite often, shared memory is in fact implemented by memory mapping
files
. Under this scenario, processes can communicate using shared memory
by having the communicating processes memory-map the same file into their
virtual address spaces. The memory-mapped file serves as the region of shared
memory between the communicating processes (Figure 9.23).



enter image description here




Thanks.









share

























    up vote
    0
    down vote

    favorite












    Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seems to me that it is a chicken-egg problem.



    Operating System Concepts introduces sharing a memory-mapped file in the following.
    Do the multiple processes share the same file by sharing the same physical memory region holding the content of the file?




    Multiple processes may be allowed to map the same file concurrently,
    to allow sharing of data. Writes by any of the processes modify the data in
    virtual memory and can be seen by all others that map the same section of
    the file. Given our earlier discussions of virtual memory, it should be clear
    how the sharing of memory-mapped sections of memory is implemented:
    the virtual memory map of each sharing process points to the same page of
    physical memory—the page that holds a copy of the disk block.
    This memory
    sharing is illustrated in Figure 9.22.



    enter image description here




    It also introduces shared memory in the following.



    • Do multiple processes share a memory region by sharing a memory-mapped file?


    • Does a "memory-mapped file" reside on disk or main memory? I think it is on the disk, but "The memory-mapped file serves as the region of shared
      memory between the communicating processes" seems to mean that it resides in main memory.



    Quite often, shared memory is in fact implemented by memory mapping
    files
    . Under this scenario, processes can communicate using shared memory
    by having the communicating processes memory-map the same file into their
    virtual address spaces. The memory-mapped file serves as the region of shared
    memory between the communicating processes (Figure 9.23).



    enter image description here




    Thanks.









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seems to me that it is a chicken-egg problem.



      Operating System Concepts introduces sharing a memory-mapped file in the following.
      Do the multiple processes share the same file by sharing the same physical memory region holding the content of the file?




      Multiple processes may be allowed to map the same file concurrently,
      to allow sharing of data. Writes by any of the processes modify the data in
      virtual memory and can be seen by all others that map the same section of
      the file. Given our earlier discussions of virtual memory, it should be clear
      how the sharing of memory-mapped sections of memory is implemented:
      the virtual memory map of each sharing process points to the same page of
      physical memory—the page that holds a copy of the disk block.
      This memory
      sharing is illustrated in Figure 9.22.



      enter image description here




      It also introduces shared memory in the following.



      • Do multiple processes share a memory region by sharing a memory-mapped file?


      • Does a "memory-mapped file" reside on disk or main memory? I think it is on the disk, but "The memory-mapped file serves as the region of shared
        memory between the communicating processes" seems to mean that it resides in main memory.



      Quite often, shared memory is in fact implemented by memory mapping
      files
      . Under this scenario, processes can communicate using shared memory
      by having the communicating processes memory-map the same file into their
      virtual address spaces. The memory-mapped file serves as the region of shared
      memory between the communicating processes (Figure 9.23).



      enter image description here




      Thanks.









      share













      Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seems to me that it is a chicken-egg problem.



      Operating System Concepts introduces sharing a memory-mapped file in the following.
      Do the multiple processes share the same file by sharing the same physical memory region holding the content of the file?




      Multiple processes may be allowed to map the same file concurrently,
      to allow sharing of data. Writes by any of the processes modify the data in
      virtual memory and can be seen by all others that map the same section of
      the file. Given our earlier discussions of virtual memory, it should be clear
      how the sharing of memory-mapped sections of memory is implemented:
      the virtual memory map of each sharing process points to the same page of
      physical memory—the page that holds a copy of the disk block.
      This memory
      sharing is illustrated in Figure 9.22.



      enter image description here




      It also introduces shared memory in the following.



      • Do multiple processes share a memory region by sharing a memory-mapped file?


      • Does a "memory-mapped file" reside on disk or main memory? I think it is on the disk, but "The memory-mapped file serves as the region of shared
        memory between the communicating processes" seems to mean that it resides in main memory.



      Quite often, shared memory is in fact implemented by memory mapping
      files
      . Under this scenario, processes can communicate using shared memory
      by having the communicating processes memory-map the same file into their
      virtual address spaces. The memory-mapped file serves as the region of shared
      memory between the communicating processes (Figure 9.23).



      enter image description here




      Thanks.







      linux virtual-memory shared-memory shared-file





      share












      share










      share



      share










      asked 1 min ago









      Tim

      23.9k67232418




      23.9k67232418

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474946%2fare-sharing-a-memory-mapped-file-and-sharing-a-memory-region-implemented-based-o%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474946%2fare-sharing-a-memory-mapped-file-and-sharing-a-memory-region-implemented-based-o%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay