summaryrefslogtreecommitdiffstats
path: root/generic/tclTimer.c
Commit message (Collapse)AuthorAgeFilesLines
* merge sebres-event-perf-fix-busy-waitsebres_8_6_event_perf_branchsebres2017-07-131-1/+0
|\
| * timer: fixed setup of the block-time to 0.0 by pending timer of new ↵sebres2017-07-131-1/+0
| | | | | | | | | | generation, example: tclsh -c "proc test {} {after 1000 test}; test; vwait infinite"
* | merge resp. reintegrate sebres-8-5-event-perf-branch to 8.6sebres2017-07-101-441/+1230
|\ \ | |/
| * after at: added simple workaround for absolute timers/sleep ("after at ↵sebres2017-07-031-3/+26
| | | | | | | | | | | | | | | | | | real-time"): because we use monotonic time in all wait functions, so to avoid too long wait by the absolute timers (to be able to trigger it) if time jumped to the expected absolute time, just let block for maximal 1 second if absolute timers available. test-cases: time-jumps (TIP #302) test covered now. Note: on some platforms it is only possible if the user has corresponding privileges to change system date and time. Ex.: sudo LD_LIBRARY_PATH=. ./tclsh ../tests/timer.test -match timer-20.*
| * Introduced monotonic time as ultimate fix for time-jump issue (fixed for ↵sebres2017-07-031-115/+75
| | | | | | | | | | | | | | windows and unix now, TIP #302 fully implemented now); Usage of monotonic time instead of adjustment via timeJump/timeJumpEpoch is more precise and effective. New sub-command "clock monotonic" to provide monotonic time facility for tcl-level.
| * fixed timer-marker handling: timer should be always executed after queued ↵sebres2017-07-031-20/+9
| | | | | | | | | | | | event (of the same generation), it was marked (be sure it marked to immediate execution in corresponding checkProc only). tclIO: scheduled event rewritten using Tcl_Event instead of timer event (IO is not timer, e. g. executed also by usage of `vwait -notimer ...`, etc).
| * interim commit: trying to pass test-cases - timer-3.*, chan-io-29.34, ↵sebres2017-07-031-18/+31
| | | | | | | | socket-2.12 (busy prompt timer, unexpected too early timer event, wrong timer-marker usage)
| * "after at" set factor to 1000000 (seconds), test cases fixed sebres2017-07-031-5/+5
| |
| * code review, rewrite tclTimer, prolongation, etc. sebres2017-07-031-332/+460
| |
| * interim commit: code review, rewrite tclTimer, etc. sebres2017-07-031-77/+141
| |
| * revert dual lists (relative/absolute) back to single list (because of better ↵sebres2017-07-031-109/+63
| | | | | | | | handling, a bit faster, etc.)
| * amend with review sebres2017-07-031-16/+53
| |
| * interim commit: trying to resolve time-freezes with new facilities ↵sebres2017-07-031-105/+134
| | | | | | | | timeJump/timeJumpEpoch
| * interim commit: trying to resolve time-freezes with new facilities ↵sebres2017-07-031-167/+345
| | | | | | | | timeJump/timeJumpEpoch
| * interim commit: try to fix time-drift backwards (calibration? something ↵sebres2017-07-031-1/+1
| | | | | | | | else?)...
| * interim commit: try to fix time-drift backwards (too long offset after ↵sebres2017-07-031-3/+22
| | | | | | | | calibration? something else?)...
| * after info, after cancel: compare interpreter of the timer-events by direct ↵sebres2017-07-031-2/+2
| | | | | | | | retrieving via internal representation (ignore foreign events), test cases extended.
| * resolved some warnings / fixed unix resp. x64 compilation sebres2017-07-031-4/+4
| |
| * code review + better usage of the waiting tolerance (fewer CPU-greedy now, ↵sebres2017-07-031-3/+35
| | | | | | | | | | | | | | avoid busy-wait if the rest of wait-time too small and can be neglected); TMR_RES_TOLERANCE can be defined to use wait-tolerance on *nix platforms (currently windows only as relation resp. deviation between default timer resolution 15.600 in exact milliseconds, means 15600/15000 + small overhead); Decreasing of TMR_RES_TOLERANCE (up to 0) makes tcl more "RTS" resp. NRT-capable (very precise wait-intervals, but more CPU-hungry).
| * [win32] use timer resolution handling in Tcl_Sleep also; sebres2017-07-031-10/+12
| |
| * dynamic increase of timer resolution corresponding wait-time; sebres2017-07-031-20/+24
| | | | | | | | non-blocking wait for event - if block-time set outside an event source traversal, use it as timeout, so can return with result 0 (no events);
| * [enhancement] extend "vwait" with same options as "update", new syntax ↵sebres2017-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | "vwait ?options? ?timeout? varname". some small improvements and fixing: - Tcl_DoOneEvent can wait for block time that was set with Tcl_SetMaxBlockTime outside an event source traversal, and stop waiting if Tcl_SetMaxBlockTime was called outside an event source (another event occurs and interrupt waiting loop), etc; - safer more precise pre-lookup by options (use TclObjIsIndexOfTable instead of simply comparison of type with tclIndexType); test cases extended to cover conditional "vwait" usage;
| * [performance] do one event (update / event servicing) cycle optimized ↵sebres2017-07-031-23/+99
| | | | | | | | | | | | | | (introduced threshold to prevent sourcing resp. waiting for new events by no-wait). [enhancement] new event type introduced: TCL_ASYNC_EVENTS, command "update" becomes options to process only specified types, resp. to bypass some event types (including -idle/-noidle that in opposite to "idletasks" does not included window events); test cases extended.
| * [performance] much better handling for timer events within Tcl_ServiceEvent ↵sebres2017-07-031-90/+28
| | | | | | | | | | | | using timer marker in the queue and direct call of TclServiceTimerEvents if marker reached (instead of continuous adding handler event, polling it in the queue and removing hereafter); this provides double performance increase in the service cycle;
| * [performance] large performance increase by event servicing cycles (3x - 5x ↵sebres2017-07-031-123/+91
| | | | | | | | | | | | | | | | faster now); [win] prevent listen using PeekMessage twice, and no wait anymore for too short timeouts (because windows can wait too long), compare 0µs with up-to 100µs overhead within MsgWaitForMultipleObjectsEx; [bad behavior] process idle events only as long as no other events available (now TclPeekEventQueued will be used to check new events are available in service idle cycle); [enhancement] new option "noidletasks" for command "update", so "update noidle" means "process all events but not idle";
| * [performance] introduced additional queue for prompt timer events (after 0) ↵sebres2017-07-031-213/+265
| | | | | | | | | | | | that should be executed immediately (no time); normalizes timer, prompt and idle events structures using common TimerEntry structure for all types;
| * bug fix: wrong release of after-id tcl-object if it switch type (object leak) sebres2017-07-031-7/+13
| |
| * [bug/stable fix] don't execute TimerSetupProc directly (may be unwanted, ↵sebres2017-07-031-21/+55
| | | | | | | | | | | | | | because changes the blocking time, also if TCL_TIMER_EVENTS|TCL_IDLE_EVENTS not set), so let do that within Tcl_DoOneEvent cycle only (we have registered an event source). [performance] optimization for "after 0" as immediately execution without time (invoke as soon as possible) - generation and invocation of such timers twice faster now. [performance] leave handler-event in the queue as long as pending timers still available (with expired time or immediate timers) by generation lock, resp. changed/not invalidated timer-queue) - so fewer event/allocations and guarantee to be executed within the next event cycle;
| * after-id: introduced object of type "afterObjType" as self-referenced weak ↵sebres2017-07-031-29/+174
| | | | | | | | | | | | pointer to timer/idle event, used for fast access to the "after" event (cancel, info etc.); test cases extended to cover it additionally
| * timer resp. idle events optimized: better handling using doubly linked ↵sebres2017-07-031-190/+349
| | | | | | | | lists, prevents allocating memory twice for the "after" events (use memory inside timer/idle event for the "after" structure), etc.
| * [performance] after-event list optimized (interp-assoc switched to doubly ↵sebres2017-07-031-33/+26
| | | | | | | | linked list, because requires handling from both ends of the list)
* | Implement Tcl_NewBooleanObj, Tcl_DbNewBooleanObj and Tcl_SetBooleanObj as ↵jan.nijtmans2013-04-231-1/+1
|\ \ | |/ | | | | | | | | macros using Tcl_NewIntObj, Tcl_DbNewLongObj and Tcl_SetIntObj. Starting with Tcl 8.5, this is exactly the same, it only eliminates code duplication. Eliminate use of NO_WIDE_TYPE everywhere: It's exactly the same as TCL_WIDE_INT_IS_LONG
* | more result generation conversiondkf2012-08-031-4/+5
| |
* | Factor out constant that must be the same in multiple places. Prompted by adkf2012-05-251-6/+3
| | | | | | conversation with Alexandre Ferrieux.
* | Reduce use of Tcl_AppendElement, which is not (and can't be) a Tcl_Obj-aware ↵dkf2011-05-091-3/+5
| | | | | | | | API.
* | More generation of error codes ([format], [after], [trace], RE optimizer).dkf2011-04-041-14/+20
| |
* | Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts indkf2011-03-121-15/+15
| | | | | | rest of Tcl source code. No ABI change. API change *should* be harmless.
* | Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\ \ | |/ | | cause more harm than good. Purged them (except in zlib files).
| * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\ | | | | | | more harm than good. Purged them.
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | | | | more harm than good. Purged them.
| | * Bug 1350293Kevin B Kenny2005-11-091-2/+3
| | |
| | * Tcl_ClearChannelHandlers(): bail out early if passed NULL argumentvasiljevic2005-10-041-3/+6
| | |
| | * purge outdated commentdgp2005-03-231-4/+2
| | |
| | * * generic/tclTimer.c: Removed a premature optimisation thatKevin B Kenny2004-09-071-14/+4
| | | | | | | | | | | | | | | | | | attempted to store the assoc data in the client data; the optimisation caused a bug that [after] would overwrite its imports. [Bug 1016167]
* | | Stop small [afters] from wasting CPU [Bug 2905784] while keeping accuracy.ferrieux2010-10-291-5/+21
| | |
* | | Pure whitespace changes, changing to follow Engineering Manual style.dkf2010-02-241-3/+3
| | |
* | | Minor formatting issuesdkf2009-12-281-7/+6
| | |
* | | * generic/tclExecute.c: fix potential uninitialized variable use anddas2009-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclFCmd.c: null dereference flagged by clang static * generic/tclProc.c: analyzer. * generic/tclTimer.c: * generic/tclUtf.c: * generic/tclExecute.c: silence false positives from clang static * generic/tclIO.c: analyzer about potential null dereference. * generic/tclScan.c: * generic/tclCompExpr.c:
* | | - eliminate some unnessary type castsnijtmans2009-02-101-3/+3
| | | | | | | | | | | | | | | - some internal const decorations - spacing
* | | Style fixes (unfouling whitespace, sorting comments, removing useless casts, ↵dkf2009-01-091-22/+19
| | | | | | | | | | | | etc.)