<i>Notification when there's no data</i> status still Open with 6 other changes
by
.
D 2001-09-27T09:08:27
J icomment \n\nFile\sAdded\s-\s11261:\s462317.diff.0\n\nLogged\sIn:\sYES\s\nuser_id=75003\n\nIn\sdirect\sinteraction\swith\sKevin\n(email)\sit\swas\sdetermined\sthat\sthe\nfollowing\sinteracting\sfactors\sgenerated\nthe\sproblem\sreported\shere.\sA\spatch\sto\nthe\sTcl\sI/O\score\swas\screated\sand\stested\nextensively.\sThe\spatch\ssurvives\sthe\ntestsuite\sand\salso\sremoves\sthe\sreported\ndeadlock.\n\nThe\spatch\shere\sis\sthe\ssecond\sone\sto\sfix\nthe\sbug.\sThe\sfirst\spatch\swas\sdone\nagainst\sExpect\sitself\sand\swhipped\sup\sto\nprovide\sa\smore\simmediate\sworkaround\nwhile\strying\sto\sfind\sthe\strouble\sspot.\n\n-\sTcl\shad\sa\snumber\sof\sbytes\sin\sits\n\s\sinput\sbuffers\sand\sused\sa\stimer\sto\n\s\sgenerate\sartificial\sfileevents\sto\n\s\sdrain\sthem.\n\n-\sExpect\sreceived\sthese\sevents\sand\sread\n\s\sdata\sfrom\sthe\schannel.\sIt\salso\sasked\n\s\sfor\smore\sdata\sthan\swas\sbuffered.\n\n-\sEpect\shad\sset\sthe\spty\schannel\sto\n\s\snon-blocking\sand\stherefore\sexpected\n\s\sto\sget\sshort\sreads\sif\sasking\sfor\sdata\n\s\sthan\savailable.\n\n-\sThe\sassociated\spty\schannel\sdriver\sdid\n\s\snot\sprovide\sa\sblockmodeproc\sthrough\n\s\swhich\sthe\sTcl\sI/O\score\stells\sa\sdriver\n\s\swhether\sa\schannel\sis\sblocking\sor\snot.\n\n\s\sIOW,\swhile\sthe\sTcl\sI/O\score\shad\sto\n\s\sprovide\snon-blocking\ssemantics\sthe\n\s\sunderlying\sOS\scall\swas\sactually\n\s\sblocking.\n\n-\sWhen\sExpect\sasked\sfor\smore\sdata\sthan\n\s\savailable\sthe\sTcl\sI/O\score\sstarted\sto\n\s\sread\sfrom\sOS,\sassuming\sthat\sthe\n\s\sunderlying\sOS\scall\swould\snot\sblock\sas\n\s\sthe\schannel\swas\sset\snon-blocking.\sThe\n\s\scall\swas\sblocking\sinstead\sand\sclosed\n\s\sthe\schain\sof\sdependencies,\screating\n\s\sthe\sdeadlock.\n\nSolution:\n\nThe\sTcl\sI/O\sis\schanged\sto\n\n-\sassume\sthat\sthe\sunderlying\sOS\scalls\n\s\sare\sblocking\sif\sa\sdriver\sdoes\snot\n\s\sprovide\sa\sblockmodeproc.\n\n-\snever\stry\sto\sread\sfrom\sthe\sOS\sif\sit\n\s\sis\snot\scertain\sthat\sdata\sis\savailable,\n\s\snon-blocking\sbehaviour\sis\sexpected\sby\n\s\sthe\scaller\sand\sthe\sunderlying\sOS\scall\n\s\sassumed\sto\sbe\sblocking.\n\nThe\slast\sitem\smeans\sin\spractice\sthat\nread\srequests\sgenerated\swhile\shandling\na\stimer\sgenerated\sfileevent\sare\nrestricted\sto\sthe\sdata\sin\sthe\sinput\nbuffers\sof\sthe\schannel\sin\squestion.\n\nTrying\sto\sread\smore\swill\ssignal\nEWOULDBLOCK\sand\scause\sthe\scaller\sto\ssee\na\sshort\sread.\n\n
J login andreas_kupries
J mimetype text/plain
J priority 7\sHigh
J resolution Fixed
J username andreas_kupries
K 462317ffffffffffffffffffffffffffffffffff
U andreas_kupries
Z 2aaa4b6e36f23dbcad3f587d4b0c0f0f