Skip to content
Tcl Source Code Artifact [ca3eba570d]
Login

Artifact [ca3eba570d]

Artifact ca3eba570d2bc937f0b116c6ad29001dcb204d08:

Ticket change [ca3eba570d] - Ticket [577014ffffffffff|577014ffff] <i>documentation; wait on thread exits</i> status still Open with 4 other changes by elfring on 2002-08-06 07:56:21.
D 2002-08-06T07:56:21
J icomment Logged\sIn:\sYES\s\nuser_id=572001\n\nWell,\sI've\sgot\sanother\sidea.\n\nWhen\swe\stalk\sabout\sshell\sbackground\s\nprocesses,\sthen\swe\stalk\salso\sabout\sthe\s"special"\scase\sthat\sthere\sis\sonly\sone\s\nforeground\sprocess.\sI\sthink\sthat\sthe\sshell\scommand\s"wait"\sdoes\snothing\smore\s\nthan\sto\swait\suntil\sone\sprocess\sis\sleft\srunning\sagain.\n\nHow\scan\swe\smap\s\nthis\ssituation\sto\sthreads?\nI\sthink\sthat\sit's\sunusual\sto\stalk\sabout\sforeground\s\nand\sbackground\sthreads\sbecause\sall\sthreads\sare\sexecuted\sat\sthe\ssame\slevel.\s\nWe\sdivide\sthreads\sby\stheir\sresponsibility.\sBut\sit's\smore\scommon\sto\scall\sthem\s\nmanager\sand\sworker\sthreads.\sSeveral\smanager\sthreads\sthat\sdelegate\sjobs\sto\s\nthe\sworker\sthreads\sare\sstarted\sat\sthe\sbeginning\sof\sa\sprocess.\nMy\sgoal\sis\sto\s\nachieve\sa\ssituation\swhere\sthe\sset\sof\srunning\sthreads\sis\sthe\ssame\safter\ssome\s\nworker\sthreads\swere\sexecuted.\sI\swould\slike\sthe\sfunction\s"thread::wait"\sto\sbe\s\nadjusted\sso\sthat\sit\sdoes\san\sother\swait\sinstead\sof\san\s"vwait".\sI\ssuggest\sthe\s\nfollowing\sfunction\scalls.\n\n#\sStore\scurrent\sthread\ssituation\nset\s\nforeground\s[thread::names]\n\n#\sCreate\ssome\s"background"/worker\s\nthreads\nforeach\st\s{function1\sfunction2\sfunction3}\s{thread::create\s\n$t}\n\n#\sWait\suntil\sthe\sadditional\sthreads\sfinished\sexecution\sby\swaiting\s\nthat\sthe\slist\sof\srunning\sthreats\swill\sbe\s"restored".\nthread::wait\s-on\sIDs\s\n$foreground\n
J login elfring
J mimetype text/plain
J username elfring
K 577014ffffffffffffffffffffffffffffffffff
U elfring
Z f9ce0a9bfadb4ff9c456f4b5e051a670