Skip to content
Tcl Source Code Artifact [0069b23f06]
Login

Artifact [0069b23f06]

Artifact 0069b23f069fa18ae1629307deba34a5809ed750:

Ticket change [0069b23f06] - New ticket [3536564fffffffff|3536564fff] <i>tcl hangs on parallel execution of commands using open</i>. by anonymous on 2012-06-20 11:28:05.
D 2012-06-20T11:28:05
J assignee andreas_kupries
J cmimetype text/plain
J comment Hi,\s\n\n\sI\sam\slooking\sto\srun\sa\scouple\sof\sprocesses\sin\sparallel.\sBut\sa\sstrange\shang\soccurs\srandomly.\sI\sam\sinvoking\stwo\stcl\scommands\susing\sopen\sin\sparallel.\sNow\safter\sa\swhile\sone\sof\sthe\sprocess\swould\sjust\shang\sindefinitely\swhich\sI\sam\snot\sable\sto\sunderstand\swhy.\sThe\sissue\sis\seasily\sreproducible\son\swin\s2008\sserver\sand\sother\smulti\score\smachines.\sAm\sI\sdoing\ssomething\swrongly?\sWhat\sis\sthe\sbest\sway\sto\sdo\sthis?\s\n\nTo\sreproduce,\syou\sjust\shave\sto\screate\sthe\sfiles\sand\srun\sloop.bat.\sYou\sshould\ssee\sthe\shang\swithin\s15-20\sminutes.\s\n\nFollowing\sare\sthe\sfiles\sI\sam\susing\s\n\n********\s\nloop.bat\s\n******\s\n@echo\soff\s\n:loop\s\ntclsh\s1.tcl\s\ngoto\sloop\s\n\n*****************\s\nContents\sof\sfile\s1.tcl\s\n*****************\s\n#!/bin/sh\s\n#DO\sNOT\sCHANGE\sTHOSE\s3\sFIRST\sLINES\s\\\s\nexec\stclsh\s$0\s"$@"\s\n\nset\sstatus\s[catch\s{\sexec\stclsh\s2.tcl\s}\soutcmd]\s\nputs\s$outcmd\s\nexit\s0\s\n\n*******\s\nContents\sof\sfile\s2.tcl\s\n*****\s\n#!/bin/sh\s\n#DO\sNOT\sCHANGE\sTHOSE\s3\sFIRST\sLINES\s\\\s\nexec\stclsh\s$0\s"$@"\s\n\nset\scmd1\s"tclsh\s6.tcl\s&"\s\nset\scmd2\s"tclsh\s5.tcl\s&"\s\nset\sout1\s""\s\nset\sout2\s""\s\n\nproc\sisProcessDone\s{\schannel\slogText\s}\s{\s\n\s\s\s\sgets\s$channel\scurrentline\s\n\s\s\s\swhile\s{[eof\s$channel]\s==\s0}\s{\s\n\s\s\s\s\s\s\s\sset\slogText\s"$logText\\n\s$currentline"\s\n\s\s\s\s\s\s\s\sgets\s$channel\scurrentline\s\n\s\s\s\s}\s\n\s\s\s\sreturn\s$logText\s\n}\s\n\nputs\s"hi"\s\nset\simChannel1\s[open\s"|\s$cmd1"]\s\nputs\s"hi1\s$imChannel1"\s\nset\simChannel2\s[open\s"|\s$cmd2"]\s\nputs\s"hi2\s$imChannel2"\s\n#set\simChannel3\s[open\s"|\s$cmd"]\s\n\n\nif\s{\s${imChannel1}\s!=\s""\s}\s{\s\n\s\s\s\s\s\s\s\sputs\s1\s\n\s\s\s\s\s\s\s\sfileevent\s$imChannel1\sreadable\s[set\sout1\s[isProcessDone\s$imChannel1\s$out1]]\s\n\s\s\s\s\s\s\s\sputs\s11\s\n\s\s\s\s\s\s\s\sputs\s$out1\s\n}\s\n\nif\s{\s${imChannel2}\s!=\s""\s}\s{\s\n\s\s\s\s\s\s\s\sputs\s2\s\n\s\s\s\s\s\s\s\sfileevent\s$imChannel2\sreadable\s[set\sout2\s[isProcessDone\s$imChannel2\s$out2]]\s\n\s\s\s\s\s\s\s\sputs\s22\s\n\s\s\s\s\s\s\s\sputs\s$out2\s\n}\s\n\nputs\s"bye"\s\n\nexit\s0\s\n\n****\s\nContents\sof\s5.tcl\sand\s6.tcl\s\n******\s\n#!/bin/sh\s\n#DO\sNOT\sCHANGE\sTHOSE\s3\sFIRST\sLINES\s\\\s\nexec\stclsh\s$0\s"$@"\s\n\nputs\s"\\ncallexec\s6\sstarted"\s\nputs\s"\\ncallexec\s6\sterminated"\s\n\nPlease\shelp.\s\n\nTIA.\s\nDeepanshu\s
J foundin obsolete:\s8.4.15
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J subsystem 24.\sChannel\sCommands
J title tcl\shangs\son\sparallel\sexecution\sof\scommands\susing\sopen
J type Bug
K 3536564fffffffffffffffffffffffffffffffff
U 
Z 64a5c5a14652fe397260d4794d2891d6