| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
event-cycle (Tcl_DoOneEvent) produced in event-cycle without processing
|
|
|
|
|
| |
generation, example:
tclsh -c "proc test {} {after 1000 test}; test; vwait infinite"
|
|\ |
|
| |
| |
| |
| |
| | |
object and object leakage.
closes [adb198c256df8c4192838cc3c1112fb2821314e9]
|
| | |
|
| | |
|
| |
| |
| |
| | |
documented.
|
| |
| |
| |
| | |
and max blocking time was not set outside an event source traversal.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
avoid reset block time by nested event-cycles (if Tcl_SetTimer does not create it), etc.
Fixed retarded events (using new retarded list, the involve of the retarded events occurs only after checking of all event sources now).
Two opportunities to retard event:
- lazy, using the same event-object: in the handler set event->proc to new (or the same) handler (fast, possible only if not entering new event-cycle in handler);
- create the event with new position "TCL_QUEUE_RETARDED";
New inline functions TclpQueueEventClientData / TclpQueueEventEx to fast creating resp. queuing event with extra data.
|
| |\ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.*
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
wide-clicks supported);
because of variable width of 1 wide-click: windows - frequency dependent, unix - nanoseconds, darwin/osx - tb.numer / tb.denom nanoseconds.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
(too slow by large queue) - rewritten to cancel delayed (by execute it).
|
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | |
| | |
| | |
| | | |
socket-2.12 (busy prompt timer, unexpected too early timer event, wrong timer-marker usage)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Amend to timer-marker: dualize special state of timer-marker (to differentiate between timer generations), so:
INT2PTR(-1) - exec immediate (marker reached);
INT2PTR(-2) - check in the next-cycle (marker reached only if no other events available);
Avoids permanent busy execution of prompt-events (always busy in timer), if they regenerate itself continuously for waiting for other events (like writable/readable), see e. g. socket-2.12.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
handling, a bit faster, etc.)
|
| | | |
|
| | |
| | |
| | |
| | | |
wait before end-time, on small timeout values (like 0.5, etc.)
|
| | |
| | |
| | |
| | | |
timeJump/timeJumpEpoch
|
| | |
| | |
| | |
| | | |
timeJump/timeJumpEpoch
|
| | |
| | |
| | |
| | | |
else?)...
|
| | |
| | |
| | |
| | | |
calibration? something else?)...
|
| | |
| | |
| | |
| | | |
wait-time, that may expire immediately (for example `vwait 0.0001 test`).
|
| | |
| | |
| | |
| | | |
retrieving via internal representation (ignore foreign events), test cases extended.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | |
| | |
| | |
| | |
| | | |
Otherwise depending on the VC-version, context, include-order it can cause:
error C2054: expected '(' to follow 'inline'
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
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);
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
"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;
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
(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.
|
| | |
| | |
| | |
| | |
| | |
| | | |
process pending events only (without wait), negative value equivalent execution of "vwait" without timeout (infinite);
test cases fixed and extended;
|
| | |
| | |
| | |
| | |
| | |
| | | |
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;
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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";
|
| | |
| | |
| | |
| | |
| | |
| | | |
that should be executed immediately (no time);
normalizes timer, prompt and idle events structures using common TimerEntry structure for all types;
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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;
|
| | |
| | |
| | |
| | |
| | |
| | | |
pointer to timer/idle event, used for fast access to the "after" event (cancel, info etc.);
test cases extended to cover it additionally
|
| | |
| | |
| | |
| | | |
delete callback)
|
| | |
| | |
| | |
| | | |
lists, prevents allocating memory twice for the "after" events (use memory inside timer/idle event for the "after" structure), etc.
|
| | |
| | |
| | |
| | | |
linked list, because requires handling from both ends of the list)
|