.
D 2001-04-17T11:27:49
J assignee nobody
J cmimetype text/plain
J comment This\sis\shaving\sdifficulty\son\swindows.\s\sIsn't\sthe\sc-\nruntime\ssupposed\sto\shandle\sthis\ssituation\sjust\sfine?\s\s\nI'm\sperplexed\sby\sthis:\n\n\npackage\srequire\sThread\n\nforeach\sa\s{1\s2\s3\s4\s5\s6}\s{\n\s\s\sset\sthreads($a)\s[thread::create\s{\sproc\sdoit\s{}\s{\s\nputs\s[expr\s{rand()}]\s};\sthread::wait\s}]\n}\n\nforeach\sa\s{1\s2\s3\s4\s5\s6}\s{\n\s\s\sthread::send\s-async\s$threads($a)\sdoit\n}\n\nforeach\sa\s{1\s2\s3\s4\s5\s6}\s{\n\s\s\sthread::send\s-async\s$threads($a)\sthread::exit\n}\n\n\nC:\\Program\sFiles\\Tcl\\bin>tclsh84t\n%\ssource\stest.tcl\n%\s0.0541875106535\n0.0541875106535\n0.0541875106535\n0.0541875106535\n0.0541875106535\n0.0541875106535\n\n\nI\sreally\sdon't\sthink\sthis\sis\sa\sTcl\sinherit\sto\sTcl,\sbut\s\ndoes\sshow\san\sinteresting\sbehavior.\s\sChanging\sthe\srun\s\nto\sbe\ssyncronous\sgot\sthis:\n\npackage\srequire\sThread\n\nforeach\sa\s{1\s2\s3\s4\s5\s6}\s{\n\s\s\sthread::create\s{\sputs\s[expr\s{rand()}]\s}\n}\n\n%\ssource\stest.tcl\n0.11639496317\n0.366838779471\n0.366838779471\n0.484234318363\n0.609456226513\n%\s0.726851765405\n\n\nThe\sdocs\sstate\s"Each\sinterpreter\shas\sit's\sown\sseed."\s\non\sthe\sexpr\sman\spage,\sbut\sI\stend\sto\sdisagree\safter\s\nseeing\sthe\sabove.\s\sWhere's\sthe\sseeding\shappening?\s\s\nShould\sTcl_CreateInterp()\sdo\sthe\sseeding?
J foundin obsolete:\s8.4a2
J priority 5\sMedium
J resolution None
J status Open
J submitter davygrvy
J subsystem 49.\sThreading
J title rand()\shas\sidentical\sresults\sin\sthreads.
J type Bug
K 416643ffffffffffffffffffffffffffffffffff
U davygrvy
Z aa8a3112e8933ccbbbff927719508050