Skip to content
Tcl Source Code Artifact [7234f22561]
Login

Artifact [7234f22561]

Artifact 7234f22561a704752df24ecafc02b5df43f97210:

Ticket change [7234f22561] - New ticket [2905784fffffffff|2905784fff] <i>Sync [after] works too hard</i>. by ferrieux on 2009-11-30 00:16:17.
D 2009-11-30T00:16:17
J assignee kennykb
J cmimetype text/plain
J comment Synchronous\s[after]\smakes\smany\scalls\sto\sthe\sunderlying\sOS's\sgetttimeofday()\sor\sequivalent.\nThis\sis\sdue\sto\san\sill-defined\sresponsibility\sboundary\sbetween\sAfterDelay()\sand\sTcl_Sleep().\nIndeed,\sTcl_Sleep()\salready\shas\sthe\slogic\sto\srepeatedly\scheck\sthe\scurrent\stime\sand\swait,\snot\strusting\sthe\sOS's\stime,\sand\salso\staking\scar\sof\svirtual\stime.\nHowever,\sAfterDelay\srepeats\sthis\slogic\sone\slevel\sup,\scalling\sTcl_Sleep\sin\sa\sloop\suntil\sendTime\sis\sreached.\n\nThe\sexistence\sof\sthe\sloop\sin\sitself\shas\sgood\sreasons,\snamely\srespecting\sa\sreasonable\sgranularity\sfor\slimits\sor\sAsync\sstuff.\nBut\sin\sthe\sdegenerate,\sbut\simportant,\scase\sof\s"small"\sdelays\sbelow\sthose\slimits,\sa\svery\ssimple\soptimization\s(patch\sattached)\slets\sAfterDelay\scall\sTcl_Sleep\sexactly\sonce,\sessentially\s"trusting"\sit\son\sthe\saccuracy\sof\sthe\sresulting\swait.\sAdditionally,\sone\strivial\smove\sof\sthe\sTcl_GetTime\sin\sthe\sloop\sremoves\sone\sunwanted\sextra\sgettimeofday().\n\nThe\sbottom\sline:\sthis\spatch\smakes\sa\ssmall\s[after]\sgenerate\sonly\s3\sgettimeofday()s:\sone\son\sentry,\sto\scompute\sthe\sendTime,\sand\stwo\sinside\sTcl_Sleep.\sSqueezing\sone\smore\sout\swould\sneed\sa\schange\sin\sthe\sTcl_Sleep()\sAPI;\sI'm\snot\sattempting\sthat.\n
J foundin None
J is_private 0
J priority 7\sHigh
J resolution None
J status Open
J submitter ferrieux
J subsystem 03.\sTimer\sEvents
J title Sync\s[after]\sworks\stoo\shard
J type Bug
K 2905784fffffffffffffffffffffffffffffffff
U ferrieux
Z b9409982df35dab77893b93bfcc2495d