Skip to content
Tcl Source Code History Of Ticket 2891362
Login

History Of Ticket 2891362

Artifacts Associated With Ticket 2891362

  1. Ticket change [3ef338a96c] (rid 121364) by john13a on 2009-11-03 16:16:28:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I expect that a child interp returns after the time limit has been reached.
      
      Short example (for tclsh)
      interp create -safe test
      test limit -seconds [clock add [clock seconds] 1 second]; test eval {vwait forever}
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "john13a"
    10. subsystem initialized to: "20. [interp]"
    11. title initialized to:
      child interp with time limit does not return with eval vwait
      
    12. type initialized to: "Bug"
  2. Ticket change [3aff0821a7] (rid 112654) by dkf on 2009-11-04 21:15:37:

    1. assignee changed to: "dkf"
    2. priority changed to: "8"
  3. Ticket change [b9b40b7c0a] (rid 129198) by ferrieux on 2009-11-04 21:34:33:

    1. icomment:
      Note that this limitation is documented in TIP #143: 
      "... (with a few exceptions relating to event loop handling.) ..."
      
      Questions to dkf:
      
       (1)  any blocking syscall, not just select(), has the problem. For select() we can solve the issue by forcing a suitable periodic wake-up (at C level for performance, at script level as a quick fix for the OP), but do we want that ?
      
       (2) if the answer to (1) is Yes, is there a one-size-fits-all value for the periodicity ? If not, maybe we'd need an extra script-level API to pass this value ([interp limit -granularity] being only a subsampling of that), so that (say) high-load apps could pass a longer select timeout...
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [4a63e17bfc] (rid 126527) by dkf on 2009-11-04 23:10:49:

    1. icomment:
      At the moment, when there's a time limit set there will be a timer event (which does nothing) scheduled to go off at that point which will act as a wakeup call for the notifier.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [d194239a3a] (rid 113375) by dkf on 2009-11-04 23:10:50:

    1. foundin changed to: "obsolete: 8.5.7"
  6. Ticket change [dbafe2d681] (rid 108001) by ferrieux on 2009-11-05 07:13:58:

    1. icomment:
      Ah yes, but that's not implemented yet, right ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  7. Ticket change [be9e100080] (rid 102103) by dkf on 2009-12-28 16:17:48:

    1. icomment:
      Examining with a debugger (I hate doing that!) I find that limits are being checked, and that if the -granularity limit option is set to 1 then it all works.
      
      The bug is therefore that, when doing a long-running operation, the ticker is preventing the trap from doing any good. (The issue is that Tcl_GetTime is relatively expensive as operations go; you don't want to be calling it frequently when running bytecode at speed. To see what I mean, [time] how long [::tcl::clock::seconds] takes; that's very close to a raw interface to the problem syscall.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [bfee652223] (rid 102330) by dkf on 2009-12-28 17:07:48:

    1. closedate changed to: "2009-12-28T10:07:48"
    2. closer changed to: "dkf"
    3. icomment:
      
      
      allow_comments - 1
      
      Found the problem; needed to reset the granularity ticker when the timer event fires.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"
  9. Ticket change [28e5b6f32b] (rid 88783) by dkf on 2009-12-28 18:16:32:

    1. icomment:
      BTW, there's not much we can do about other blocking syscalls except to say "switch all channels given to slave interps into non-blocking mode and don't let them switch back". That covers I/O and timers are already handled in Tcl. I don't think we use any other blocking syscalls (the Thread package is something else, and it's outside my scope). File another bug if such an issue is uncovered.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"