Skip to content
Tcl Source Code Artifact [7a0970152b]
Login

Artifact [7a0970152b]

Artifact 7a0970152bfd0fe4ee07d8fd89f18e1e542d16eb:

Ticket change [7a0970152b] - Ticket [f4f44174e4c88a91|f4f44174e4] <i>protect notifier against signals</i> status still Open with 3 other changes by aspect on 2017-01-05 06:09:26.
D 2017-01-05T06:09:26.965
J icomment Just\spushed\sa\ssmall\supdate:\s\safter\srunning\sfor\ssome\s40\shours\sit\spaniced\swith\sEAGAIN\sfrom\swrite().\s\sTotally\sexpected,\sand\sshould\snot\sbe\sa\spanic\ssituation.\r\n\r\nThis\sdoes\sunderline\sthe\slimits\sof\sthis\sapproach\sthough:\r\n\r\n\r\n#1\s-\seventually\s(under\sabnormally\shigh\sTcl_AsyncMark\sload)\s-\sand\sat\sa\stime\swe\shave\slittle\sor\sno\scontrol\sover\s-\sthe\spipe\swill\sfill\sand\swe'll\sstart\sdropping\sevents.\s\sThat's\snot\sbad\s-\sit's\sthe\ssort\sof\sconstraint\ssignal\shandlers\shave\sto\sdeal\swith\s-\sbut\sit's\sone\spipe\sserving\severy\sthread,\sand\swe\shave\sno\sway\sto\sdiscard\sevents\sthat\sare\sin\sthe\sbuffer\sso\sa\shigh-priority\salert\sto\sthread\sA\scould\sbe\sstarved\sby\slow-priority\salerts\sto\sthread\sB.\s\sNot\sthe\sbest,\seven\sfor\sa\spathological\sscenario.\r\n\r\nThe\sway\sthe\soriginal\sscheme\sdegraded\swas\sactually\svery\snice:\s\sevents\swould\sbe\slost\sif\sthey\sarrived\swhile\stheir\shandler\swas\srunning,\shigh-priority\sevents\swould\salways\sget\sto\sthe\shead\sof\sthe\squeue\s(without\spre-empting\sother\shandlers)\sand\scross-thread\scontention\swas\s..\sbroken\sby\smisusing\sa\smutex,\sbut\stheoretically\sfairly\sgood\s:).\r\n\r\n\r\n#2\s-\sWindows.\s\sAccording\sto\sMSDN,\sCreatePipe()s\sare\ssynchronous\s"rendezvous"\spipes:\s\swrites\sblock\suntil\sa\sread\soccurs.\s\sAlso,\sI'm\snot\sreally\ssure\swhat\sthe\sbest\sinterpretation\sof\s"signal\shandler"\sis\son\sWindows\sbut\s[https://msdn.microsoft.com/en-us/library/xdkz3x12.aspx]\ssays\sPOSIX-style\ssighandlers\scan't\suse\s"low-level\sor\sstdio.h\si/o"\sor\ssystem\scalls.\r\n\r\nAn\sactual\sWindows\sexpert's\sopinion\son\swhat\slimits\sAsyncMark\sshould\srespect\sis\sa\sgood\sidea\shere.\r\n\r\n\r\nSome\sreaders\sare\sprobably\swondering\swhy\sa\sgood\sdose\sof\satomics\sisn't\sobviously\sthe\sright\ssolution\shere:\s\sI'm\sstill\swondering\smyself.\s\sI\scan\salmost\ssee\show\sto\sdo\sit,\sbut\scan't\sget\spast\sthe\sloss\sof\seither:\r\n\r\n\s\s-\scheap\sasyncReady:\s\sas\sin\schecking\sa\ssingle\sword\sin\sInterp,\swith\sno\smutex\r\n\s\s-\ssafety:\s\sTcl_AsyncMark\snot\scausing\smemory\serrors\sif\scalled\swith\sa\sdeleted\stoken,\sa\stoken\sfor\sa\sdeleted\sinterp,\sor\sa\stoken\sthat\sbecomes\sdeleted\swhile\sAsyncMark\sis\srunning.
J login aspect
J mimetype text/plain
K f4f44174e4c88a9132b19bcc4b68346a1d229fe1
U aspect
Z aa0b01bcf0d2e415c363428b6f922b42