Overview
| Artifact ID: | a36f783de685664d6cbdb22d3474233e233f2646 |
|---|---|
| Ticket: | 3328635fffffffffffffffffffffffffffffffff
Virtual Time broken on threaded unix |
| User & Date: | ferrieux on 2011-06-24 20:37:32 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
In threaded unix builds, timer events use pthread_cond_timedwait, which needs an absolute target time. The computation of this target is broken, because it adds the (correct) scaled==real delta to the (incorrect) virtual Tcl_GetTime. The fix is to use real time for the latter. Moreover, in some unices, the clock used for pthread_cond_timedwait can be selected among several, with pthread_condattr_setclock at condvar creation time. One of them, CLOCK_MONOTONIC, has the extra advantage of being insensitive to system clock tweaks. I think that selecting it when possible can only improve things, since it allows: - usual, tip-302-sensitive [after] semantics unchanged, since the timer events are also stored as absolute epoch-time targets by Tcl - fully working Virtual Time with clock_gettime(CLOCK_MONOTONIC) giving tip-302-insensitive [after]. I have a provisional patch for platforms with clock_gettime+CLOCK_MONOTONIC, designed to enable Joe Keen's code in http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/8f820c68143850f9# . Some autogoo would be due before committing. An alternative to 'select monotonic if possible, epoch if not' would be a runtime setting, like a ::tcl::unsupported::monotonicTime linked var. To be discussed. - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "7 High"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "ferrieux"
- subsystem changed to: "03. Timer Events"
- title changed to: "Virtual Time broken on threaded unix"
- type changed to: "Bug"