is `write()` asynchronous write?

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











up vote
0
down vote

favorite












From Operating System Concepts




Another issue that can affect the performance of I/O is whether writes
to the file system occur synchronously or asynchronously.



Synchronous
writes
occur in the order in which the disk subsystem receives them,
and the writes are not buffered. Thus, the calling routine must wait
for the data to reach the disk drive before it can proceed.



In an
asynchronous write, the data are stored in the cache, and control
returns to the caller.



Most writes are asynchronous. However, metadata
writes, among others, can be synchronous. Operating systems frequently
include a flag in the open system call to allow a process to request
that writes be performed synchronously.
For example, databases use
this feature for atomic transactions, to assure that data reach stable
storage in the required order.




Is it correct that write() is blocking, and returns when finish writing to the buffer cache, not necessarily to the file?



So is write() asynchronous write by the definition in the quote?



"Operating systems frequently include a flag in the open system call to allow a process to request that writes be performed synchronously." By calling what functions can you achieve synchronous write, and how do you call them?



Thanks.










share|improve this question

























    up vote
    0
    down vote

    favorite












    From Operating System Concepts




    Another issue that can affect the performance of I/O is whether writes
    to the file system occur synchronously or asynchronously.



    Synchronous
    writes
    occur in the order in which the disk subsystem receives them,
    and the writes are not buffered. Thus, the calling routine must wait
    for the data to reach the disk drive before it can proceed.



    In an
    asynchronous write, the data are stored in the cache, and control
    returns to the caller.



    Most writes are asynchronous. However, metadata
    writes, among others, can be synchronous. Operating systems frequently
    include a flag in the open system call to allow a process to request
    that writes be performed synchronously.
    For example, databases use
    this feature for atomic transactions, to assure that data reach stable
    storage in the required order.




    Is it correct that write() is blocking, and returns when finish writing to the buffer cache, not necessarily to the file?



    So is write() asynchronous write by the definition in the quote?



    "Operating systems frequently include a flag in the open system call to allow a process to request that writes be performed synchronously." By calling what functions can you achieve synchronous write, and how do you call them?



    Thanks.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      From Operating System Concepts




      Another issue that can affect the performance of I/O is whether writes
      to the file system occur synchronously or asynchronously.



      Synchronous
      writes
      occur in the order in which the disk subsystem receives them,
      and the writes are not buffered. Thus, the calling routine must wait
      for the data to reach the disk drive before it can proceed.



      In an
      asynchronous write, the data are stored in the cache, and control
      returns to the caller.



      Most writes are asynchronous. However, metadata
      writes, among others, can be synchronous. Operating systems frequently
      include a flag in the open system call to allow a process to request
      that writes be performed synchronously.
      For example, databases use
      this feature for atomic transactions, to assure that data reach stable
      storage in the required order.




      Is it correct that write() is blocking, and returns when finish writing to the buffer cache, not necessarily to the file?



      So is write() asynchronous write by the definition in the quote?



      "Operating systems frequently include a flag in the open system call to allow a process to request that writes be performed synchronously." By calling what functions can you achieve synchronous write, and how do you call them?



      Thanks.










      share|improve this question













      From Operating System Concepts




      Another issue that can affect the performance of I/O is whether writes
      to the file system occur synchronously or asynchronously.



      Synchronous
      writes
      occur in the order in which the disk subsystem receives them,
      and the writes are not buffered. Thus, the calling routine must wait
      for the data to reach the disk drive before it can proceed.



      In an
      asynchronous write, the data are stored in the cache, and control
      returns to the caller.



      Most writes are asynchronous. However, metadata
      writes, among others, can be synchronous. Operating systems frequently
      include a flag in the open system call to allow a process to request
      that writes be performed synchronously.
      For example, databases use
      this feature for atomic transactions, to assure that data reach stable
      storage in the required order.




      Is it correct that write() is blocking, and returns when finish writing to the buffer cache, not necessarily to the file?



      So is write() asynchronous write by the definition in the quote?



      "Operating systems frequently include a flag in the open system call to allow a process to request that writes be performed synchronously." By calling what functions can you achieve synchronous write, and how do you call them?



      Thanks.







      linux io write






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 14 mins ago









      Tim

      24k67232419




      24k67232419

























          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%2f475328%2fis-write-asynchronous-write%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%2f475328%2fis-write-asynchronous-write%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