Artifacts Associated With Ticket 2891362
Ticket change [3ef338a96c] (rid 121364) by john13a on 2009-11-03 16:16:28:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- 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} - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "john13a"
- subsystem initialized to: "20. [interp]"
- title initialized to:
child interp with time limit does not return with eval vwait
- type initialized to: "Bug"
Ticket change [3aff0821a7] (rid 112654) by dkf on 2009-11-04 21:15:37:
- assignee changed to: "dkf"
- priority changed to: "8"
Ticket change [b9b40b7c0a] (rid 129198) by ferrieux on 2009-11-04 21:34:33:
- 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...
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [4a63e17bfc] (rid 126527) by dkf on 2009-11-04 23:10:49:
- 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.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [d194239a3a] (rid 113375) by dkf on 2009-11-04 23:10:50:
- foundin changed to: "obsolete: 8.5.7"
Ticket change [dbafe2d681] (rid 108001) by ferrieux on 2009-11-05 07:13:58:
- icomment:
Ah yes, but that's not implemented yet, right ?
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [be9e100080] (rid 102103) by dkf on 2009-12-28 16:17:48:
- 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.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [bfee652223] (rid 102330) by dkf on 2009-12-28 17:07:48:
- closedate changed to: "2009-12-28T10:07:48"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Found the problem; needed to reset the granularity ticker when the timer event fires.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"
Ticket change [28e5b6f32b] (rid 88783) by dkf on 2009-12-28 18:16:32:
- 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.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment: