Re: 'clock microseconds' broken on Windows
- From: Helmut Giese <hgiese@xxxxxxxxxxxxx>
- Date: Sun, 16 May 2010 21:10:01 +0200
I would like to correct the subject: It's not broken, it's by 'design
out of necessity'.
Background (for those interested in technical details): Each core has
a fast running 'performance counter' (aka 'high resolution timer'),
which is at the base of every attempt to get sub-millisecond
resolution.
The problem is that on multicore machines those timers can (and
apparently will) get out of sync. Since one cannot rely on always
executing on the same core getting the counter value introduces an
element of random: A value you get may (appear to) lie in the past -
or in a distant future.
It is for this reason that Tcl deliberately relinquishes use of this
timer if a 'safe environment' cannot be determined. So far nobody
seems to have found a satisfying solution.
A word of WARNING: If anybody wants to use the "work around" I posted:
Please be aware, that it is subject to the same problem: Sukzessive
calls need not be executed on the same core - hence may report values
from different timers - hence may produce surprising results.
Sigh, sorry for the bad news.
Helmut Giese
.
- Follow-Ups:
- Re: 'clock microseconds' broken on Windows
- From: MartinLemburg@Siemens-PLM
- Re: 'clock microseconds' broken on Windows
- References:
- 'clock microseconds' broken on Windows
- From: Helmut Giese
- 'clock microseconds' broken on Windows
- Prev by Date: Re: bug in 8.5.6 http package? or maybe tls?
- Next by Date: Text entry dialog widget pre-made?
- Previous by thread: 'clock microseconds' broken on Windows
- Next by thread: Re: 'clock microseconds' broken on Windows
- Index(es):
Relevant Pages
|