Skip to content
Tcl Source Code Artifact [f3ebee58c9]
Login

Artifact [f3ebee58c9]

Artifact f3ebee58c946c61f13805a67aa42ae7744957e4f:

Ticket change [f3ebee58c9] - Pending ticket [3611974fffffffff|3611974fff]: <i>InitSubsystems multiple thread issue</i> plus 8 other changes by jan.nijtmans on 2013-06-18 10:40:19.
D 2013-06-18T10:40:19.492
J assignee aku
J closer nobody
J comment The\smutex\sarrangement\sin\sTclInitSubsystems()\sseems\r\nto\ssuffer\sfrom\sa\ssignificant\sflaw.\s\sConsider\stwo\sthreads,\r\nA\sand\sB,\scalling\sthe\sroutine\sconcurrently.\s\sThread\sA\sgets\r\nthe\slock\sfirst,\ssets\ssubsystemsInitialized\sto\s1\sand\sstarts\r\ncalling\sthe\sset\sof\ssubsystem\sinitializing\sroutines.\r\n\r\nMeanwhile\sthread\sB\smakes\sthe\sinitial\stest\s\r\n(subsystemsInitialized\s==\s0)\sand\ssince\sthread\sA\r\nhas\salready\sset\sit\sto\s1,\sthread\sB\sjumps\sstraight\r\nto\sthe\sbottom\sof\sTIS()\sand\scalls\sTclInitNotifier().\r\n\r\nThe\strouble\sis\swhen\sB\scalls\sTclInitNotifier(),\swe\r\nhave\sno\sidea\show\smuch\sof\sTcl\slibrary\sinitialization\r\nis\sactually\sdone.\s\sWe\sjust\sknow\sit\sgot\sstarted.
J icomment I\sthink\sthere\sis\sa\smuch\ssimpler\ssolution,\scommitted\snow\sto\score-8-5-branch\sand\strunk.\sThe\soriginal\scode\scontains\sthe\scomment:\s"Have\sto\sset\sthis\sbit\shere\sto\savoid\sdeadlock\swith\sthe\sroutines\sbelow\sus\sthat\scall\sinto\sTclInitSubsystems.".\sThat\smay\shave\sbeen\strue\sin\sthe\spast,\sbut\scurrently\snone\sof\sthe\s"routime\sbelow"'s\scall\sTclInitSubsystems().\sThis\smeans\sthat\ssubsystemsInitialized\scan\sbe\sset\sto\s1\sas\sfinal\sstep,\swhich\sfixes\sthe\swhole\sthread\sissue.\r\n\r\nThis\smeans\sthat\sbranch\s"bug-3611974"\sis\sno\slonger\snecessary.\sAgreed?
J login jan.nijtmans
J mimetype text/plain
J resolution Fixed
J severity Minor
J status Pending
K 3611974fffffffffffffffffffffffffffffffff
U jan.nijtmans
Z 5e9e1697962e1b4c8dafc3dcaeb2f407