<i>[fcopy -command] on serial port floods the event queue</i> status still Open with 4 other changes
by
.
D 2001-09-05T21:48:58
J icomment Logged\sIn:\sYES\s\nuser_id=99573\n\nSorry\sfor\sresponding\sso\slate\s-\sI\sjust\sreturned\sfrom\s\nvacation.\n\nThere\sare\sa\sfew\sspecialities\saround\sserial\sports:\n-\sA\sserial\sfileevent\soccures\swhen\sthere\sis\sat\sleast\s\n\s\s1\schar\savailable.\n\s\sIn\sthe\scase\sabove\sthis\sshould\shappen\sat\snearly\severy\n\s\sevent\scheck.\n-\sA\snon-blocking\sread\sreturns\sthe\snumber\sof\savailable\s\n\s\sbytes\sin\sthe\sinput\squeue.\n\nWhen\sthere\sare\scontineous\sfileevents\sobviously\s\nno\sIDLE\scallbacks\swill\sbe\sexecuted.\s\nIMO\sthat's\sintentional\sdone.\nI\salso\ssee,\sthat\s-pollinterval\sdoesn't\schange\sanything\n(see\s3.\sbelow).\n\nDebugging\sthe\sscript\sabove\sshows\ssome\sstrangeness\s\nwhen\sapplied\sto\sthe\sserial\schannel.\nIt\scontineously\sperforms\snon-blocking\sreads\s\nwhile\sresetting\sthe\sevent\smask:\n\n1.\sSerialBlockProc(mode=1)\s\n\s\s\s\s\s\s\s\s#\sSet\snon-blocking\smode\n2.\sSerialInputProc()\s\n\s\s\s\s\s\s\s\s#\sReturns\sa\sfew\sbytes\sfrom\sthe\sserial\sport\n\s\s\s\s\s\s\s\s#\sWrites\sthese\sbytes\sto\soutput\schannel\s\n(microscopic\swrites\s!!!)\n3.\sSerialWatchProc(mask=0)\s\n\s\s\s\s\s\s\s\s#\smask=0\s->\sTcl_SetMaxBlockTime()\snot\scalled\n\s\s\s\s\s\s\s\s#\sThat's\swhy\s-pollinterval\sdoesn't\shelp.\n\s\s\s\s\s\s\s\s#\sThis\salso\sresets\sthe\sinternal\swatch\smask.\n4.\sSerialCheckProc()\n\s\s\s\s\s\s\s\s#\sDoesn't\sdetect\sany\sevent,\sbecause\swatch\smask\s\n\s\s\s\s\s\s\s\shas\sbeen\sreset\sby\s3.\n5.\sRepeat\ssteps\s2.-5.\s\n\s\s\s\s\s\s\s\s#\sUntil\s8000\sbytes\shave\sbeen\sread\n6.\sSerialBlockProc(mode=0)\s\n\s\s\s\s\s\s\s\s#\sRestore\soriginal\sblocking\smode\n\nIt\sseems\sto\sme,\sthat\sthe\sthere\sis\sat\sleast\s1\sproblem\nwith\sfcopy\sand\sserial\sports.\n\ntclIO.c:CopyData()\sconsiders\sonly\sto\scases\safter\s\nDoRead():\n\s\s\s\ssize\s<\s0:\s\sError\n\s\s\s\ssize\s==\s0:\sInstall\sa\sreadable\shandler\nBut\sin\sour\scase\swe\salmost\salways\swill\shave\sthe\scase\sthat\n\s\s\s\s0\s<\ssize\s<\stoRead\nIMO\sthis\sshould\sat\sleast\senable\sthe\s-pollinterval\soption\s\nto\savoid\smicroscopic\swrites.\nBut\sI'm\snot\ssure,\swhether\sinstalling\san\sevent\shandler\sfor\s\n(0\s<\ssize\s<\stoRead)\swould\shelp\swith\sthe\sIDLE\sproblem.\s\n\nBTW\sthere\sone\smore\spotential\sproblem\swith\sfcopy,\swhen\s\nwriting\sto\sa\sserial\nport:\n-\sThe\scurrent\s(Tcl8.2-8.3)\simplementation\sof\sthe\sserial\s\n\s\sdriver\sdoesn't\ssupport\snon-blocking\swrites.\n\s\sThat\swill\sbe\schanged\swith\sTIP#35.\n\nRolf.\n\n
J login schroedter
J mimetype text/plain
J username schroedter
K 219311ffffffffffffffffffffffffffffffffff
U schroedter
Z 0b17f20f78e12ee2acfed47a99fafa30