Skip to content
Tcl Source Code History Of Ticket a11678b759
Login

History Of Ticket a11678b759

Artifacts Associated With Ticket a11678b759

  1. Ticket change [2bbb7b8897] (rid 203102) by oehhar on 2022-08-18 09:58:08:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The documentation of the after command may be improved as follows:
      
         *   Add information: "after 0 cmd" puts the command in front of the event queue. Other already registered events will run after this event. This is indirectly contained in a remark at the very bottom of the page.
         *   Eventually say/define, what happens for negative time "after -1 cmd" ? I don't know what it does, but there is no error message. Maybe legalize it ;-).
         *   Eventually say something about the maximum value of the wait time.
         *   At the bottom of the page, there is an example "after idle [list after 0 doOneStep]". This guarantees to keep the GUI responsive. To my knowledge, specially metawidgets like TkTable also require "after 200" events to run to show correctly. To my knowledge, this is not the case. Also, what is the advantage over "update (idletasks)? I basically don't understand the information (even as the wiki page is great).
      
      I will care about the first point. Any opinions on the other points welcome.
      
      Thank you all,
      Harald
      
    5. foundin initialized to: "any"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to: "documentation improvement: "after 0 cmd""
    16. type initialized to: "RFE"
  2. Ticket change [4b37062d84] (rid 203103) by sebres on 2022-08-18 11:19:13:

    1. icomment:
      > *"after 0 cmd" puts the command in front of the event queue. Other already registered events will run after this event.*
      
      This is not quite correct. Basically when adding to the queue it considers other timers there, so in case other events with 0 are already available, it would add new event after them and not in head of the queue. Also it is important to consider the "epoch" of event (an event created during evaluation of another event will be executed firstly by the next round of event cycle evaluation).
      
      Negative offset is the same as 0.
      
      Regarding `after idle [list after 0 doOneStep]`, it will guarantee that `doOneStep` will be evaluated in the second round of event cycle, but firstly after the idle round was done too. It is a kind of retarding of events (surely not the best one) either because of the nested `update`s somewhere or because of missing filter functionality by `update` or `vwait` (e. g. impossibility to invoke `update -timer` or `update -noidle` like implemented in RFE [fdfbd5e10](./tktview?name=fdfbd5e10)).
      Fundamentally although it can be helpful sometimes, but may be a bit worse concept to rely on timers in this way. It could be sometimes also a sign that a code doesn't register or handle events correctly (instead of count on some state it trust in a time-related evaluation).
      
    2. login: "sebres"
    3. mimetype: "text/x-markdown"
  3. Ticket change [9d0e895439] (rid 203104) by oehhar on 2022-08-18 11:51:05:

    1. icomment:
      Thanks, Sergey, I appreciate.
      
      I suppose, it is quite complicated to express this in the man page.
      
      I looked to the implementation. Apparently "after 0" is not a no-op, but does wait a sort of a cycle.
      
      Also, the wide int time is split to a long type as seconds.
      There are calculations on a long type without any guard against overflow.
      A long is 32 bit. So, with 4.294.967.296 seconds, I will hit an overflow.
      
      <verbatim>
      % after 4294967296000 "puts a"
      after#8
      a
      </verbatim>
      
      It returns immediately. So, there is an overflow ;-).
      
      Maybe, overflow handling would be great.
      
      Take care,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/plain"
    4. username: "oehhar"
  4. Ticket change [7df041f742] (rid 203108) by oehhar on 2022-08-18 12:05:07:

    1. icomment:
      Text proposal in branch [ticket-a11678b759-after-documentation] starting with commit [2706ae6bed].
      
      Apparently a hot potato issue.
      
      Any comment welcome,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  5. Ticket change [1e6e90fe1e] (rid 203109) by oehhar on 2022-08-18 12:13:23:

    1. icomment: "Here is the after overflow ticket: [1802895]"
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  6. Ticket change [f43aa9afcb] (rid 203998) by oehhar on 2022-09-09 14:28:51:

    1. closedate changed to: "2459832.10337376"
    2. closer changed to: "oehhar"
    3. icomment:
      Changes merged by [2221b9b6e3].
      
      I close this now.
      
      Thanks,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "oehhar"