Re: our friend the win32 system timer.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: our friend the win32 system timer.
Date: 2004-08-16 19:44:27
Message-ID: 200408161944.i7GJiRG01217@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Merlin Moncure wrote:
> Depending on how you look at it, this may be a semi-serious problem in
> win32. pg uses the C library time routines to calculate elapsed time
> and supply values.
>
> Unfortunately, this value is only updated for each timeslice allocated
> to the thread. The resolution of this timer is about 10 ms...
>
> This means that a table with a timestamp column defaulted to now() and a
> unique constraint on that column will have a very high chance of
> constraint violations. This might happen when reading in values from a
> script, and it works fine on Linux.
>
> A side issue is that psql analyze timings are not useful below 10 ms.
> Should the win32 high performance counter, QueryPerformanceCounter, be
> introduced?

This seems like a very minor limitation to me.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Magnus Hagander 2004-08-16 20:49:28 Re: REPOST: InitDB Failure on install
Previous Message Merlin Moncure 2004-08-16 19:25:01 our friend the win32 system timer.