Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] SRA Win32 sync() code

From: "Steve Tibbett" <stevex(at)stevex(dot)org>
To:
Cc: "'PostgreSQL Win32 port list'" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [PATCHES] SRA Win32 sync() code
Date: 2003-11-20 00:35:03
Message-ID: 3F61636001D91D89@mta3.wss.scd.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
>I was thinking about sync() --- one of its problems is that is schedules
writes 
>to disk but returns before it is completed.  If we do sync(), then open,
write, 
>fsync, close a file, aren't we then pretty sure all the scheduled sync
writes 
>have completed too?  I know SCSI has tagged queueing, but I figured
creating 
>a new file and writing/fsync would come after the sync writes.

Sorry to jump in in the middle of this but I'm just wondering if some of the
Win32 file creation flags might help out here.. if the problem is figuring
out how to flush stuff to the disk, what about using FILE_FLAG_NO_BUFFERING?
I'm not sure how you'd create a stdio FILE with custom CreateFile flags but
there's probably a way, I can see if I can figure it out if it looks like it
would be useful.

There are quite a few flags that are Win32 specific but that might help for
various things, like..

FILE_FLAG_DELETE_ON_CLOSE (you can't delete a file while it's open, but you
can open it specifying that it go away when you close it, in the case where
you know it's a temp file).

FILE_ATTRIBUTE_TEMPORARY (an optimization that hints to the filesystem that
this is a temporary file so don't bother writing it to disk (keep it in the
cache) unless you need to).

FILE_FLAG_WRITE_THROUGH (kinda like FILE_FLAG_NO_BUFFERING but different..
the SDK docs describe how they interact).

 - Steve



In response to

pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2003-11-20 01:17:29
Subject: Re: Is there going to be a port to Solaris 9 x86 in the
Previous:From: Peter EisentrautDate: 2003-11-19 23:42:58
Subject: Re: Build farm

pgsql-patches by date

Next:From: ViSolve Open Source TeamDate: 2003-11-20 00:55:26
Subject: (Modified) Patch request for PostgreSQL 7.4 for HP-UX IA-64
Previous:From: Euler Taveira de OliveiraDate: 2003-11-20 00:09:20
Subject: internationalization of initdb

pgsql-hackers-win32 by date

Next:From: Claudio NatoliDate: 2003-11-27 08:46:32
Subject: Re: fork/exec
Previous:From: Manfred SpraulDate: 2003-11-19 21:07:57
Subject: Re: [pgsql-hackers-win32] SRA Win32 sync() code

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group