Re: after ids
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Thu, 17 Apr 2008 14:02:42 -0700 (PDT)
On 16 avr, 16:34, Kevin Kenny <kenn...@xxxxxxx> wrote:
OK, so I think it deserves a TIP (is there one already ?). Again to
stay on the radar... If nobody else steps forward, maybe I could write
it, but I'd appreciate your eventual implication in the ref
implementattion.
TIPs are not needed for changes that affect only performance and
do not change the API. Reorganizing [after] to use a better data
structure is something that we can just do as a performance enhancement.
OK, I stand corrected. But is it sufficient reason to ignore it during
one year and four months ?
Had somebody told me it was not TIPpable, I would have happily moved
it to a more appropriate channel...
Did you see my comment at the bottom? I've misgivings about
whether it's feasible. Yes, I've *looked* at it.
Two answers:
(1) no, I hadn't seen your comment at the bottom until now, because
there is no e-mail notification of TIP updates apparently (or it
failed on me, or on Gmail's antispam, etc.)
(2) I disagree with the comment. Quoting you:
> The times function in Unix is not an appropriate time base.
> It reports the user and system time (CPU time, in other words)
> of the currently executing process and its children...
What you say accurately describes what times() returns in its argument
structure. But it also has a return value, which is of type clock_t,
and, quoting the manpage:
>> times() returns the number of clock ticks that have elapsed
>> since an arbitrary point in the past.
So again, why is not an appropriate time base ?
(2) wake up at a particular (UTC or local) time, tracking any clock
changes that take place.
"Tracking" is a bit of an exaggeration. "Undergoing" would be closer
to the truth...
Well, with a functioning NTP infrastructure, it's a non-issue.
Yes but not everybody has this. I routinely get to handle machines
jailed in strange subnetworks with armies of firewall around, and NTP
not an option. Nor would it deserve any effort: on these machines,
accuracy of the 'date' command is not required. Only from time to time
a sysadmin may find too large a drift and decide to take action,
without imagining the harm this operation does to Tcl (and on Tcl
alone, since sh's sleep command uses setitimer() which is also
insensitive to date-setting).
Even today, the [after] command doesn't depend on time zone changes,
Yeah, this red herring has been covered to death on c.l.t :-)
We both know TZ and DST are a separate layer from the true time base
ticking [after], let's dismiss that.
I would be very surprised to see a single example of a beneficial, or
even depended-upon, effect of a gettimeofday()-shift on [after].
I have one important one: NBC.
[...] So unlike your assertion that the
hardware clock is "rock solid" while system time is capricious,
in the NBC system, system time is traced to a primary reference
OK, I understand the specific need, but:
(1) this is closer in my view to an [at] command, rather than an
[after]
(2) even with a ticks-based, drifting time reference in [after], it
would be easily achievable with a two-resolution scheme: a periodic
task running every (say) minute, checking [clock], and posting short-
range [after]s.
(3) Conversely, even in the current implementation, with a tight NTP
hand on the system clock, if there is one single long [after] with no
intervening events, Tcl will compute one single select() timeout
value, and the syscall will sleep until its end, regardless of any
intervening NTP corrections; so it will suffer from the drift. Of
course, this won't happen if the select() is frequently interrupted by
other events (including shorter-term afters), since in this case
gettimeofday() is called at each time to recompute the next target).
Is it your case ?
(4) I'd be curious to know how many dozens of cases of the stalled
periodic task there are per single NBC-like case ... But I admit the
voice of a TCT member can weigh higher than 1 ;-)
configured to Just Work is easier.) Your suggestion in TIP #302
of using times() is not workable, because times() reports CPU time,
not wall-clock time; when a process is idle, times() does not
advance.
Not true, see above :-}
Perhaps my experience is unusual, but it's been literally years
since I've set a system clock by the wristwatch-and-eyeball method.
Even my wristwatch (like millions of others) gets its time from
NIST; there's a WWVB receiver aboard that resynchronizes daily to
the radio signal from Fort Collins.
I understand, but again, if your experience is "unusual", mightn't it
be advisable to ease the life of the Neandertalian masses including
myself ? (of course with an explicit option, like the -robust in the
TIP)
-Alex
.
- Follow-Ups:
- Re: after ids
- From: Kevin Kenny
- Re: after ids
- References:
- after ids
- From: vitick
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: Bruce Hartweg
- Re: after ids
- From: Darren New
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: Alexandre Ferrieux
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: Alexandre Ferrieux
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: Alexandre Ferrieux
- Re: after ids
- From: George Peter Staplin
- Re: after ids
- From: Alexandre Ferrieux
- Re: after ids
- From: Kevin Kenny
- Re: after ids
- From: Alexandre Ferrieux
- Re: after ids
- From: Kevin Kenny
- after ids
- Prev by Date: Re: how to substitute a variable with a variable value
- Next by Date: Re: Possible revival of comp.lang.tcl.announce
- Previous by thread: Re: after ids
- Next by thread: Re: after ids
- Index(es):
Relevant Pages
|