Why not use timeEndPeriod? - NTP
This is a discussion on Why not use timeEndPeriod? - NTP ; Hi,
i found a strange question. when i use my ntpdate to
synchronize time in my network(*), the cpu usage rises
to a high level, and when i stop ntpdate, cpu reaches a
proper value.
so, i found the following ...
-
Why not use timeEndPeriod?
Hi,
i found a strange question. when i use my ntpdate to
synchronize time in my network(*), the cpu usage rises
to a high level, and when i stop ntpdate, cpu reaches a
proper value.
so, i found the following code in ntpdate.c, the point is
when we called "timeBeginPeriod" to adjust the timer,
we should call the pare function "timeEndPeriod".
without doing this, the cpu usage for each process
might rise a little bit, and the total cpu usage might
rises a higher level(normally 30% higher).
is that something wrong with the function call?
thanks for any hints or thoughts.
-----------------------------------------------------------------------------------------------------------------
wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax);
/* establish the minimum timer resolution that we'll use */
timeBeginPeriod(wTimerRes);
/* start the timer event */
wTimerID = timeSetEvent(
.....
-----------------------------------------------------------------------------------------------------------------
YOYO
2006/08/29, Shanghai, China
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions
-
Re: Why not use timeEndPeriod?
YOYO,
YOYO wrote:
> Hi,
>
> i found a strange question. when i use my ntpdate to
> synchronize time in my network(*), the cpu usage rises
> to a high level, and when i stop ntpdate, cpu reaches a
> proper value.
>
> so, i found the following code in ntpdate.c, the point is
> when we called "timeBeginPeriod" to adjust the timer,
> we should call the pare function "timeEndPeriod".
> without doing this, the cpu usage for each process
> might rise a little bit, and the total cpu usage might
> rises a higher level(normally 30% higher).
>
> is that something wrong with the function call?
> thanks for any hints or thoughts.
You're right, timeEndPeriod should be called when an application shuts down
which has called timeBeginPeriod at startup.
For ntpd I've submitted a patch which calls these functions properly to set
the Windows multimedia timer optionally to highest resolution while ntpd is
active. This is in order to avoid time steps which are introduced if
another application which uses the MM timer is started or stopped.
However, in case of ntpdate using the MM timer does not make sense anyway,
IMHO, so we should remove the timeBeginPeriod call, or add the missing
timeEndPeriod call. Some cleanup is required, anyway. If you agree I'll
open a bugzilla issue on this.
Martin
--
Martin Burnicki
Meinberg Funkuhren
Bad Pyrmont
Germany
-
Re: Why not use timeEndPeriod?
Martin Burnicki wrote:
> YOYO,
>
> YOYO wrote:
>> Hi,
>>
>> i found a strange question. when i use my ntpdate to
>> synchronize time in my network(*), the cpu usage rises
>> to a high level, and when i stop ntpdate, cpu reaches a
>> proper value.
>>
>> so, i found the following code in ntpdate.c, the point is
>> when we called "timeBeginPeriod" to adjust the timer,
>> we should call the pare function "timeEndPeriod".
>> without doing this, the cpu usage for each process
>> might rise a little bit, and the total cpu usage might
>> rises a higher level(normally 30% higher).
>>
>> is that something wrong with the function call?
>> thanks for any hints or thoughts.
>
> You're right, timeEndPeriod should be called when an application shuts down
> which has called timeBeginPeriod at startup.
>
> For ntpd I've submitted a patch which calls these functions properly to set
> the Windows multimedia timer optionally to highest resolution while ntpd is
> active. This is in order to avoid time steps which are introduced if
> another application which uses the MM timer is started or stopped.
>
> However, in case of ntpdate using the MM timer does not make sense anyway,
> IMHO, so we should remove the timeBeginPeriod call, or add the missing
> timeEndPeriod call. Some cleanup is required, anyway. If you agree I'll
> open a bugzilla issue on this.
>
> Martin
Agreed. But why are you using ntpdate at all? ntpd does everything you
need and more and runs as a service on Windows. Once you set it up you
are done, unless you need to change the list of servers in which case
you change the list and restart the service.
Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions
-
Re: Why not use timeEndPeriod?
Hi Martin Burnicki
Thank you very much and i really appreciate it.
Could you please issue a bugzilla on this ? Thanks a lot.
Danny :
Thank you for your advice, I began with NTP from ntpdate
so i was used to find something in ntpdate. Now I'll try to
use ntpd instead...
YOYO
2006/09/04
> You're right, timeEndPeriod should be called when an application shuts down
> which has called timeBeginPeriod at startup.
>
> For ntpd I've submitted a patch which calls these functions properly to set
> the Windows multimedia timer optionally to highest resolution while ntpd is
> active. This is in order to avoid time steps which are introduced if
> another application which uses the MM timer is started or stopped.
>
> However, in case of ntpdate using the MM timer does not make sense anyway,
> IMHO, so we should remove the timeBeginPeriod call, or add the missing
> timeEndPeriod call. Some cleanup is required, anyway. If you agree I'll
> open a bugzilla issue on this.
>
> Martin
> --
> Martin Burnicki
>
> Meinberg Funkuhren
> Bad Pyrmont
> Germany
>
> _______________________________________________
> questions mailing list
> questions@lists.ntp.isc.org
> https://lists.ntp.isc.org/mailman/listinfo/questions
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions
-
Re: Why not use timeEndPeriod?
YOYO wrote:
> Hi Martin Burnicki
>
> Thank you very much and i really appreciate it.
> Could you please issue a bugzilla on this ? Thanks a lot.
Done, see:
https://ntp.isc.org/bugs/show_bug.cgi?id=698
Martin
--
Martin Burnicki
Meinberg Funkuhren
Bad Pyrmont
Germany