<i>No processing of after events</i> status still Open with 3 other changes
by
.
D 2017-02-15T20:49:44.241
J icomment Unfortunately\sI\sthink\sa\slot\sof\sdata\spresented\shere\shas\sno\srelationship\swith\sthe\sproblem.\sFirst\sof\sall\s665544332211\sis\sfine\scoming\sout\sof\sTcl_GetWideIntFromObj().\sAlso\syour\s64-bit\sexample\sis\smostly\sharmless.\sSure,\sthe\s{puts\sone}\sevent\sfires\stoo\searly,\sbut\sit\sdoesn't\sblock\sother\sevents\sfrom\srunning\sat\stheir\sproper\stimes.\sThat\sis\sthe\smain\sproblem\sI\swas\strying\sto\sraise.\r\n\r\nWhat\shappens\swith\s665544332211\son\sa\s32-bit\ssystem\sis\sthat\sthe\sspecified\snumber\sof\smilliseconds\sis\sdivided\sby\s1000\sand\sadded\sto\sthe\scurrent\stime\sin\sseconds.\sThis\sthen\sgets\sstored\sin\sa\s32-bit\sinteger.\sWhile\ssorting\sthe\slinked\slist\sof\stimer\sevents\s(TclCreateAbsoluteTimerHandler()),\sthis\snumber\sis\streated\sas\snegative\sand\sthus\sends\sup\sat\sthe\shead\sof\sthe\slist.\sHowever,\swhen\scalculating\sthe\stimeout\sfor\sthe\sfirst\sevent\sin\sthe\slinked\slist\s(TimerSetupProc()),\sthe\scurrent\stime\sis\ssubtracted,\smaking\sthe\svalue\sa\slarge\spositive\snumber\sagain.\sThis\sblocks\sother\sevents\sin\sthe\slinked\slist\sfrom\srunning\sfor\sa\slong\stime.\r\n\r\nTo\screate\sa\ssimilar\sproblem\son\sa\s64-bit\smachine,\syou\swould\shave\sto\send\sup\swith\sa\snumber\sexceeding\s1<<63\safter\sdividing\sby\s1000\sand\sadding\sthe\scurrent\stime.\sFor\sthe\sforeseeable\sfuture\sthat\swould\sactually\srequire\sat\sleast\sa\s73-bit\snumber.\sTrying\sto\suse\ssuch\sa\sbig\snumber\scauses\safter\sto\sthrow\san\serror.\sSo\sno\sbig\sproblem\sthere.\r\n\r\nMaybe\sall\snegative\svalues\spassed\sto\safter\sshould\sbe\sconverted\sto\s0\sand\sTclCreateAbsoluteTimerHandler()\sshould\streat\stime->sec\sas\san\sunsigned\sinteger\swhile\ssorting\sthe\slinked\slist.\sDoing\sthat\swill\sonly\sleave\sa\s(much\sless\ssevere)\sproblem\son\s32-bit\ssystems\swith\sevents\sscheduled\safter\s2106.\sThey\swould\sfire\sat\sthe\swrong\stime,\sbut\swon't\saffect\sother\sevents.\sCatching\sthat\sproblem\stoo\scould\sbe\sdone\sby\schecking\sthat\swakeup.sec\s+\s(long)(ms\s/\s1000)\sactually\sfits\sin\san\sunsigned\sinteger.
J login sbron
J mimetype text/plain
K 96c3f3b47d13052efb84fefb9328a195f407d859
U sbron
Z 6eede55902388980c7a33da9e727e9af