.
D 2009-08-17T16:02:26
J icomment You\scould\stry\sholding\sa\smutex\sin\sthe\smain\sthread,\ssending\sa\sjob\sto\seach\sof\sthe\sworkers\swhich\sbriefly\sgrabs\sthe\smutex\s(i.e.\swhich\sblocks\suntil\sthe\smain\sthread\sis\sready).\sSince\syou\sknow\sthat\snone\sof\sthe\sjobs\swill\scomplete,\syou\scan\sbe\ssure\sthat\syou've\sgot\sthe\spool\sfully\spopulated\sand\sthat\sit\swon't\sconsume\smore\suntil\syou're\sready.\sThen\sload\sup\sthe\spool's\squeue\swith\sthe\sreal\sjobs\sand\srelease\sthe\smutex\sfrom\sthe\smain\sthread\sto\sfire.\n\nBut\sconsider\swhether\sthis\sis\sreally\sthe\sright\sapproach.\sWith\sonly\stwo\scores,\syour\soptimal\spool\ssize\sis\spretty\ssmall\sand\sif\syou\sneed\sthe\smain\sthread\sto\sremain\sresponsive\sthen\sperhaps\syour\spool\sshould\sonly\sbe\ssize\s1!\sInvesting\sin\sa\sbigger\smachine\smay\sbe\smore\scost\seffective.\s(None\sof\sthe\sadvice\sin\sthis\sparagraph\sis\sTcl-specific;\sit\sapplies\sto\sany\sserious\ssystem\sof\sthread\spools\swithout\snasty\slocking\sproblems,\sas\sit\sis\sa\smatter\sof\ssystem\sresourcing.)\n
J login dkf
J mimetype text/plain
J username dkf
K 2835615fffffffffffffffffffffffffffffffff
U dkf
Z fde0424fc526c27aa2c058c5425b9036