.
D 2009-07-24T15:08:08
J icomment Hmmm,\sthere\sare\stwo\sseparate\sissues\shere:\s(1)\sremoving\sthe\scarpet\sunder\sa\scoro/thread\sfeet\sand\s(2)\stoo\sfast\sreuse.\nI\sfail\sto\ssee\show\sthis\swould\ssolve\s(1),\sbut\sfor\s(2)\sit\sis\sclear.\sCan\syou\sclarify\son\s(1)\s?\n\nRegarding\s(2),\sthe\s"compact\sset"\sarises\sfrom\sTcl's\sdirect\suse\sof\sOS\shandles/fd,\sand\son\sunix\sfds\sare\sa\scompact\sset.\sOn\sWindows\sAFAIK\shandles\sare\snot\sreused\s(correct\sm\sif\sI'm\swrong).\sSo,\san\salternative\sway\sof\ssolving\sthis\sissue,\swithout\sany\sintervention\sfrom\sthe\sscript\swriter,\swould\sbe\sto\sinsert\san\sindirection\sin\sTcl,\swith\san\sintentionally\scompact\sset\smanaged\sby\sTcl,\sbut\sextended\swith\sgeneration\scounts,\sso\sthat\sno\sreuse\soccurs:\n\n\s\s\s\stypedef\sstruct\s{\n\s\s\s\s\s\s\s\s\s\s\sHANDLE_OR_INT\sfd;\n\s\s\s\s\s\s\s\s\s\s\sint\sgencount;\n\s\s\s\s}\sUniqueHandle;\s\n\n\s\s\sUniqueHandle\s\s*compactArrayOfFds;\n\nThe\sidea,\sthen,\sis\sto\shave\sautomatic\schannel\snames\sof\sthe\sform\n\n\s\s\s\s\ssock3g1\n\nwhich\scan\sbe\slooked\sup\sfrom\sstring\sin\stwo\ssteps:\n\n\s\s\s\s3\sis\sthe\sindex\sin\scompactArrayOfFds\n\s\s\s\s1\sis\sthe\sgencount\sfor\sverification\n\nThis\sway,\seven\sif\sslot\s3\sof\sthe\sarray\sis\sreused,\sit\swill\shave\sa\sgencount\sof\sat\sleast\s2,\shence\sany\sstale\sreference\sto\ssock3g1\swill\sgenerate\san\serror\sinstead\sof\swreaking\shavoc\sby\sunwanted\sIO\son\sanother\schannel.\n\nNote\sthat\sthis\sworks\swell\swith\sthe\sChannel\sintrep\stoo,\sassuming\swe\sadd\sthe\sgencount\sto\sthe\sstructure.\sThen\sthe\sgencount\sverification\sis\sjust\san\sextra\sinteger\scomparison.\n\nReactions\s?\n
J login ferrieux
J mimetype text/plain
J username ferrieux
K 2826430fffffffffffffffffffffffffffffffff
U ferrieux
Z 03a5c48650ba23dccf3af994abfab029