Re: sync()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgman(at)candle(dot)pha(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: sync()
Date: 2003-01-08 06:46:57
Message-ID: 1669.1042008417@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
>> What we really need is something better than sync(), viz flush all dirty
>> buffers to disk *and* wait till they're written. But sync() and sleep
>> for awhile is the closest portable approximation.

> Are you saying that fsync() might not wait untill the IO completes?

No, I said that sync() might not. Read the man pages. HPUX's man
page for sync(2) says

sync() causes all information in memory that should be on disk to be
written out.
...
The writing, although scheduled, is not necessarily complete upon
return from sync.

regards, tom lane

In response to

Responses

  • Re: sync() at 2003-01-08 06:51:52 from Tatsuo Ishii
  • Re: sync() at 2003-01-08 14:51:01 from Bruce Momjian

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2003-01-08 06:51:52 Re: sync()
Previous Message Tom Lane 2003-01-08 06:42:42 Re: sync()