This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: timeBeginPeriod considered harmful


On Fri, Nov 11, 2005 at 05:47:17PM -0500, Pierre A. Humblet wrote:
>----- Original Message ----- 
>From: "Christopher Faylor"
>>Does anyone have any experience with the timer functions?  Pierre are
>>you still out there?  I think you had some experience with this.
>
>Not everything in the blog is true (see follow ups) and I don't know what
>to believe.

I read the article and the followups.  I don't think that anyone disagreed
with the fact that making the resolution smaller could have a negative
performance impact.

>I worked on the resolution issue a while back, to insure the following
>Posix behavior (exim relies on it):
>If you 1) call time() or equivalent, 2) sleep() or alarm() for some
>interval, 3) call time() again, then the difference between the times in
>3) and 1) cannot be smaller than the interval in 2).  Insuring that is
>easier if the resolution is known.
>I am not sure if Cygwin still behaves that way, insuring it requiring
>rounding up at various places.
>
>It has been a while since I looked at at. I will refresh my memory next week
>
>I am fairly sure that I thought about the performance issue and didn't
>observe anything negative on WinMe when the resolution was set at 1 ms.

But, MSDN says that the resolution is 1ms for 95 and, google seems to
indicate that it is 1ms for all 9x/Me class systems.  So, it may be a no-op
on Me.

>With all the multimedia stuff going on PCs these days I would be surprised
>if there was an impact that can be be blamed on Cygwin. But then,
>Windows has surprised me many times.

But Cygwin is unique in that it will turn the resolution down to 1ms and keep
it there for normal operation.  If you're watching a video or listening to
music you might expect that the rest of your system won't be really snappy.
I wouldn't expect that if I was just doing something like running a shell
script.

AFAICT, the resolution on my hyperthreaded 3GHZ system is around 15ms if
you don't use timeBeginPeriod.  I'm not really comfortable now just
turning that down to 1ms in the normal case.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]