Skip to content
Tcl Source Code Artifact [5c5896b427]
Login

Artifact [5c5896b427]

Artifact 5c5896b427bcc9bfe4f575299b24c96a37214dad:

Ticket change [5c5896b427] - Ticket [1960647fffffffff|1960647fff] <i>Add ability to use poll() in TclUnixWaitForFile()</i> status still Open with 4 other changes by das on 2008-06-15 18:21:28.
D 2008-06-15T18:21:28
J icomment Logged\sIn:\sYES\s\nuser_id=90580\nOriginator:\sNO\n\nIMO\sthe\sfact\sthat\sTclUnixWaitForFile()\sand\sTcl_Sleep()\scall\sselect()\sdirectly\sis\sfundamentally\swrong\sanyway,\sthey\sshould\sbe\susing\sthe\ssame\smechanism\sas\sthe\snotifier\sto\ssuspend,\si.e.\sin\sthe\sthreaded\scase\sthe\snotifier\sthread\sshould\sbe\sdoing\sthe\sselect\sfor\sTclUnixWaitForFile(),\ssame\sas\swaiting/polling\sfrom\sTcl_WaitForEvent().\sCalling\sselect()\sdirectly\sprevents\sbeing\swoken\sup\sfrom\sanother\sthread\s(except\sthrough\sa\ssignal),\swhich\se.g.\sprevents\sbeing\scanceled\svia\sTIP285\sduring\sa\swaitforfile\sor\ssleep.\n\nMoreover,\sas\sI\sdiscovered\sin\smy\scurrent\sreworking\sof\sthe\sMac\sOS\sX\sCoreFoundation\snotifier\sto\sadd\ssupport\sfor\sembedding,\sthe\snotifier\snot\sbeing\sused\sin\sTclUnixWaitForFile()\sand\sTcl_Sleep()\sforces\san\salternative\sevent\sloop\sto\s#ifdef\sout\sthe\sstandard\sunix\sversions\sof\sthese\sand\sreplace\sthem\s(in\smy\scase\swith\sversions\sbased\son\sCFRunLoop\sto\sensure\sthe\sembedding\sevent\sloop\skeeps\sprocessing\sevents\sduring\swaitforfile/sleep).\nIf\san\sembedder\swants\sto\sreplace\sthe\snotifier\svia\sTcl_SetNotifier()\sthis\sworkaround\sis\snot\spossible,\sand\sas\sTclUnixWaitForFile()/Tcl_Sleep()\sare\snot\shookable,\sthey\swill\svery\slikely\sbe\sa\sbig\sproblem\sfor\sany\scustom\sevent\sloop\s(such\sas\sthe\sXt\snotifier)...\n\nThis\swould\sall\sgo\saway\sif\sthe\slow-level\swaiting\saction\sin\sthe\snotifier\swere\sfactored\sout\s(i.e.\ssignaling\sthe\snotifier\sthread\sand\swaiting\son\sthe\scondition\svariable\sresp.\scalling\sselect()\sin\sthe\ssingle-threaded\scase),\sTclUnixWaitForFile()\sand\sTcl_Sleep()\scould\sthen\scall\sthis\snew\slow-level\swait\sinstead\sof\sselect()\sdirectly.\n\nI\sintend\sto\swork\son\sdoing\sexactly\sthis\sin\sthe\snext\sfew\sweeks,\sas\spart\sof\smy\slook\sat\sthe\sunix\snotifier\sto\sdelay\snotifier\sthread\screation\suntil\sneeded,\sso\sno\sneed\sto\swaste\sfurther\scycles\slooking\sat\sthis\spatch,\sit\sattacks\sthe\swrong\sproblem\sIMO.\n
J login das
J mimetype text/plain
J username das
K 1960647fffffffffffffffffffffffffffffffff
U das
Z eeb75a6a756addc81713509f55eba2f8