Re: Win32 and fsync() - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Win32 and fsync()
Date
Msg-id 303E00EBDD07B943924382E153890E5434A908@cuthbert.rcsinc.local
Whole thread Raw
In response to Win32 and fsync()  ("Dann Corbit" <DCorbit@connx.com>)
List pgsql-hackers
I think the fopen or _open family of functions all map directly to the
win32 API.  They add a little cruft, which generally makes using them
pointless, because you have less control over security, caching, and
other such things when opening the file.  There is the slight overhead
of the extra call, and the conversion of the C handle to the win32
handle.  However, all you get with the api is readfile() and
writefile(), which means workhorses like fprintf() and especially
fgets() and must be reimplemented (in lieu of using the C++ runtime).

> MS has always shipped the source code to their standard libraries on
the
> CD.  However, the compiler source remains closed.  This seems
> insignificant, but sometimes functions are totally inlined within the
> compiler (e.g. math functions like sin() and exp()).

They have a special calling convention __dllspec(naked), which strips
the function prolog and epilog and allows you to write your own in
assembly.  You can use that to write very fast functions when you don't
trust the optimizer to inline your functions.  I think your are correct
some of the math functions are written this way.

Merlin


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: PGP signing releases
Next
From: Bruce Momjian
Date:
Subject: [GENERAL] O'Reilly call for papers