Skip to content
Tcl Source Code Artifact [6cb72560ef]
Login

Artifact [6cb72560ef]

Artifact 6cb72560ef318a7ab7dff9acd7493a13d25af50c:

Ticket change [6cb72560ef] - New ticket [218582ffffffffff|218582ffff] <i>Thread logic for sockets incorrect on NT</i>. by nobody on 2000-10-26 01:02:42.
D 2000-10-26T01:02:42
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1326\sBug\nVersion:\s8.1b1\nSubmitDate:\s'1999-03-02'\nLastModified:\s'1999-03-26'\nSeverity:\sCRIT\nStatus:\sReleased\nSubmitter:\spat\nChangedBy:\sredman\nOS:\sWindows\sNT\nMachine:\sX86\nFixedDate:\s'1999-03-26'\nClosedDate:\s'2000-10-25'\n\n\nName:\nDennis\sParker\n\nCVS:\n3/1/99\svarious\sfiles\sin\sthe\s"win"\sdirectory\n\nExtensions:\nnone\n\nReproducibleScript:\n\s\s\s\sStart\stwo\sthreads\swhich\screate\sserver\ssockets,\sthe\stry\sto\sconnect\sto\sthe\n\s\s\s\ssecond\sone.\s\n\s\s\s\s\n\n\n\nObservedBehavior:\n\s\s\s\sClient\sand\sserver\shang.\n\s\s\s\s\n\n\n\nDesiredBehavior:\n\s\s\s\sNo\shanging\n\s\s\s\s\n\n\n\n\n\nFirst\sproblem\sbelow,\ssockets\snot\sthread\ssafe,\shas\sbeen\sfixed\sand\sconfirmed.\s\sNew\stest\scase\sin\ssocket.test\s(socket-13.1)\sto\scheck\sfor\sit.\s\s03/24/1999\s16:37\s-\sredman\s\n\nSecond\sproblem\snot\sfixed\syet,\srequires\schanges\sto\sallow\smultiple\sthreads\sto\sown\sthe\ssame\sfile\schannels\swithout\skilling\seach\sother.\s03/24/1999\s16:37\s-\sredman\s\n\n03/26/1999\s16:42\s-\sredman\s-\sSecond\sproblem\sfixed,\sdon't\sdestroy\sstandard\shandles\sduring\sshutdown\sof\sthreads.\n\n\s\s\sThe\sfirst\sthread\sthrough\sthe\swindows\ssocket\scode\ssets\sup\sa\shidden\swindow\n\s\s\s\sfor\suse\sin\sprocessing\swindow\smessages.\sThe\ssocket\scode\sthen\sexpects\sthat\n\s\s\s\sthe\sthread\swhich\scalls\sWSAAsyncSelect\swill\sget\sthe\smessage.\sThis\sis\n\s\s\s\sclear\sfrom\sthe\sfact\sthat\sthe\sfunction\sthat\sgets\sthe\swindow\ssocket\n\s\s\s\smessage\s(tclWinSock.c:SocketProc)\slooks\sin\sits\sown\sthread\slocal\sstorage\n\s\s\s\sto\ssearch\sfor\ssockets\sthat\shave\sselect\sdata.\s\n\n\s\s\s\sThis\sis\swrong.\sOnly\sthe\sthread\swhich\screated\sthe\swindow\swill\sreceive\sthe\n\s\s\s\smessage\n\s\s\s\sfor\sthe\swindow,\sso\sno\sother\sthread\swill\sever\sdetect\ssocket\sread_ready.\s\n\n\s\s\s\sI\shacked\sa\schange\sto\screate\sa\sglobal\slist\scontaining\sreferences\sto\sthe\n\s\s\s\ssocket\s\n\s\s\s\sstructures,\scorrelated\swith\sthread\sids.\sIn\smy\scodewhen\sSocketProc\sgets\n\s\s\s\scalled,\n\s\s\s\s(still\salways\sin\s"thread\s1",the\sfirst\sthread\sthrough\sthe\ssocket\scode),\n\s\s\s\sit\ssearches\sthe\sglobal\sstructure\sfor\ssockets\sto\scheck.\s\n\n\s\s\s\sThen\sin\sSocketCheckProc,\sI\suse\sthis\sglobal\slist\sagain\sto\ssee\sif\sany\n\s\s\s\ssocket\sneeds\n\s\s\s\san\sevent.\sIf\sone\sdoes,\sand\sthe\ssocket\sis\sowned\sby\sthe\scurrent\sthread,\sI\n\s\s\s\suse\sthe\s\n\s\s\s\sexisting\scode\spath.\sIf\snot,\sI\sexplicitly\squeue\sthe\sevent\sfor\sthe\sthread\n\s\s\s\sthat\s\n\s\s\s\sdoes\sown\sthe\ssocket,\s"thread\s2",\sand\sthen\scall\sTcl_ThreadAlert.\s\n\n\s\s\s\sI\snote\sthat\sTcl_ThreadAlert\sseems\sto\sthink\sthat\seach\sthread\shas\sa\n\s\s\s\swindow,\ssince\n\s\s\s\sit\ssends\sa\smessage\sto\sthe\swindow\sreferenced\sby\sthe\sthread's\sthread\n\s\s\s\sspecific\n\s\s\s\spointer,\sbut\sall\sthreads\shave\sthe\ssame\svalue\sfor\sthis\shandle.\sI\sdon't\n\s\s\s\sthink\sthis\swill\swork\seither.\n\n\s\s\s\sSomehow,\sthe\snew\sevent\sdoes\sget\snoticed\sin\s"thread\s2"\sin\smy\smodified\n\s\s\s\scode,\sand\n\s\s\s\sthe\saccept\sprocessing\stakes\splace\sas\syou\swould\sexpect.\sHowever,\safter\n\s\s\s\sthe\sevent\n\s\s\s\sis\sprocessed,\s"thread\s2"\sends\sup\scalling\sGetMessage,\swhich\sblocks\n\s\s\s\sforever.\n\n\s\s\s\sI\salso\snoted\s(different\sbug)\sthat\sif\syou\sstart\sa\sthread,\sand\sit\scalls\n\s\s\s\s"puts",\s\n\s\s\s\sit\screates\sits\sown\sset\sof\sconsole\sinput\sand\soutput\sthreads,\seven\sthough\n\s\s\s\sthe\n\s\s\s\s"main"\sthread\salready\shad\sa\spair.\sWhen\sthe\snew\sthread\sexits\sfor\sany\n\s\s\s\sreason,\s\n\s\s\s\sthe\sconsole\sreader\sthread\screated\sby\sthe\smain\sthread\sgets\sa\s"BAD\sFILE"\n\s\s\s\serror\n\s\s\s\sand\sthe\sprocess\sexits.\n\n\s\s\s\sThese\skind\sof\sfundamental\serrors\slead\sme\sto\sask,\shas\sanyone\sperformed\n\s\s\s\sany\s\n\s\s\s\snon-trivial\stesting\sof\sthread\ssupport\son\sNT?\n\n\s\s\s\sHoping\syour\sanswer\sis\s"yes,\sand\swe've\sfixed\smany\sbugs,\sbut\sthe\sfixes\sare\n\s\s\s\snot\s\n\s\s\s\sin\sthe\snet\scvs\srepository\syet",\sI\sask\sfurther,\swhen\sam\sI\slikely\sto\sbe\n\s\s\s\sable\sto\s\n\s\s\s\sget\sa\sversion\sthat\sactually\sworks,\seven\smostly?\n\n
J foundin obsolete:\s8.1b1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 63.\s(unused)
J title Thread\slogic\sfor\ssockets\sincorrect\son\sNT
J type Bug
K 218582ffffffffffffffffffffffffffffffffff
U nobody
Z 8fb9d4adcdd34d94a1905768e34bf792