Skip to content
Tcl Source Code History Of Ticket 432038ffffffffff
Login

History Of Ticket 432038ffffffffff

Artifacts Associated With Ticket 432038ffffffffff

  1. Ticket change [81a3397fba] (rid 117074) by s_a_white on 2001-06-11 10:43:47:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      TCL version is that supplied in TclPro1.4.
      
      Adjusting the system time affects the after event.  I
      have not checked if the problem also occurs due to
      daylight savings.
      
      Code:
      
      proc timer {} {
          puts [clock seconds]
          after 1000 {timer}
      }
      timer
      
      Change the date system time (I used date & time
      facility of KDE2).  Most of the time the above loop
      stops printing.
      
      
      Desired Behaviour:
      
      To be able to change the time and date both via TCL and
      the system without the code stopping.
      
      
    4. foundin initialized to: "obsolete: 8.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "s_a_white"
    9. subsystem initialized to: "02. Event Loops"
    10. title initialized to: "after problems when date is changed"
    11. type initialized to: "Bug"
  2. Ticket change [d7ad9c3c4f] (rid 124035) by s_a_white on 2001-06-11 22:58:02:

    1. icomment:
      Logged In: YES 
      user_id=59929
      
      After do some further checking the problem is found to be
      with changing the system clock to an earlier time.  A future
      time causes all event to trigger immediately.  As a result I
      decided to implement the same for past times.  This I feel
      is a better solution than the after events hanging for long
      periods of time.  Heres the change to
      tcl8.3.2/generic/tclTimer.c:
      
      --- tclTimer_org.cFri Apr 16 01:46:54 1999
      +++ tclTimer.cMon Jun 11 16:56:21 2001
      @@ -112,6 +112,8 @@
       } ThreadSpecificData;
       
       static Tcl_ThreadDataKey dataKey;
      +/* Keep track of our last TimerCheckProc */
      +static Tcl_Time timeCheck;
       
       /*
        * Prototypes for procedures referenced only in this file:
      @@ -158,6 +160,7 @@
       tsdPtr = TCL_TSD_INIT(&dataKey);
       Tcl_CreateEventSource(TimerSetupProc, TimerCheckProc,
      NULL);
       Tcl_CreateThreadExitHandler(TimerExitProc, NULL);
      +        timeCheck.sec = timeCheck.usec = 0;
           }
           return tsdPtr;
       }
      @@ -402,6 +405,32 @@
        */
       
       TclpGetTime(&blockTime);
      +
      +        do
      +        {
      +            if (timeCheck.sec < blockTime.sec)
      +                break;
      +
      +            if (timeCheck.sec == blockTime.sec)
      +            {
      +                if (timeCheck.usec <= blockTime.usec)
      +                break;
      +            }
      +
      +            /* System clock has been modified to a value in
      the
      +               past, trigger all timer events */
      +            {
      +                TimerHandler *timerHandlerPtr =
      tsdPtr->firstTimerHandlerPtr;
      +                do
      +                {
      +                    timerHandlerPtr->time.sec =
      timerHandlerPtr->time.usec = 0;
      +                    timerHandlerPtr           =
      timerHandlerPtr->nextPtr;
      +                } while (timerHandlerPtr != NULL);
      +            }
      +        } while (0);
      +        timeCheck.sec  = blockTime.sec;
      +        timeCheck.usec = blockTime.usec;
      +
       blockTime.sec = tsdPtr->firstTimerHandlerPtr->time.sec -
      blockTime.sec;
       blockTime.usec = tsdPtr->firstTimerHandlerPtr->time.usec -
       blockTime.usec;
      
      
      
    2. login: "s_a_white"
    3. mimetype: "text/plain"
    4. username: "s_a_white"
  3. Ticket change [fea3469ad4] (rid 108622) by hobbs on 2001-12-28 04:22:02:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      I'm not sure that I the patch is really the intent of the 
      after command.  As noticed, the problem is that Tcl does 
      the absolute time calculations, and setting the time back 
      means the actual wait is <delta>+1000, instead of 1000 
      absolute.  Of course, after is asking for relative times.  
      Another complication is that after only takes relative 
      times, and some people create cron-like agents by 
      calculating based on the current time, which would make 
      that code incorrect.
      
      I think this would require a TIP because it is a subtle, 
      but significant change.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  4. Ticket change [40f393e79f] (rid 116098) by kennykb on 2004-03-05 23:06:54:

    1. closedate changed to: "2004-03-05T16:06:54"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      Lacking an absolute reference other than the system
      clock, Tcl assumes that the intent of an [after 60000]
      issued at 10:59 is to wake up at 11:00. If the system
      clock "jumps" or exhibits non-monotonic behavior,
      that assumption is wrong, but there doesn't seem
      to be a good alternative.  I know for a fact that [after]
      is widely used for cron-like scheduling, and a change
      this subtle definitely would require a TIP.
      
      I consider the request ill-advised at present.
      
      (Really, any Unix-like system that has Internet connectivity
      should be running an NTP daemon, after which there is
      no need ever to set the system clock.)
      
      I encourage the original requester to post to c.l.t or email
      me to discuss the requirements further, in particular, to
      address what he would consider an appropriate source
      of absolute time to be, in the absence of a trustworthy
      system clock.
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"
    8. username: "kennykb"
  5. Ticket change [51f44bdff3] (rid 126219) by s_a_white on 2004-03-17 17:26:57:

    1. icomment:
      Logged In: YES 
      user_id=59929
      
      We use tcl for the graphical interface of an embedded
      instrument.  To the user it is the only application running
      and the instrument is standalone (i.e. no network
      connection).  The application is responsible for everything,
      it configures all hardware parameters (including system
      clock), lays out embedded windows, has a keyboard manager
      for keyboard navigation (there is no mouse and  only a
      simplified keyboard).
      
      The instrument can take measurements but the visual
      displaying of the results need not be in realtime.  Some
      results are performed through slow periodic updates queried
      from tcl is similar loops as shown below.
      
      We also have a scollable knob on the front panel which
      results in the equivalent of cursor key presses at very high
      speed.  We use after to determine when the events have
      slowed down to a sufficient rate that we wont overload the
      cpu when doing work as a result of those events.
      
      There are also various other cases along these lines.  In
      all cases it does not matter if the odd event executes too
      soon from after, as we can if necessary compensate in afters
      callback.  However what we cannot deal with is when the user
      adjusts the time such the all those events based of after
      appear to hang.
      
      
    2. login: "s_a_white"
    3. mimetype: "text/plain"
    4. username: "s_a_white"