Re: Win32 and fsync()

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Win32 and fsync()
Date: 2003-02-04 13:18:58
Message-ID: 303E00EBDD07B943924382E153890E5434A908@cuthbert.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2003-02-04 13:27:54 Re: PGP signing releases
Previous Message Andrew Dunstan 2003-02-04 13:05:40 Re: Win32 and fsync()