From: SourceForge.net <no...@so...> - 2011-06-24 20:37:34
|
Bugs item #3328635, was opened at 2011-06-24 22:37 Message generated for change (Tracker Item Submitted) made by ferrieux You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3328635&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 03. Timer Events Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Alexandre Ferrieux (ferrieux) Assigned to: Andreas Kupries (andreas_kupries) Summary: Virtual Time broken on threaded unix Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3328635&group_id=10894 |