<i>vwait not NRE-enabled: C stack busy</i> status still Open with 3 other changes
by
.
D 2018-04-16T18:16:47.390
J icomment Another\sproblem\swith\syield\sacross\svwait/update\setc\sis\s-\sevent-cycle\sdoes\snot\sbelong\sto\sthe\ssingle\sinterpreter.\r\n\r\nTheoretically\sone\sthread\scan\shave\smultiple\sinterpreters\s(for\sexample\sI\smyself\shave\ssuch\ssystems\se.\sg.\swith\sN\sworkers\s*\sK\sinterpreters),\sso\sdespite\sI\sdon't\suse\scoroutines\sresp.\sNRE-tailcalls\sacross\smain-cycle,\sI\swould\snot\slike\sto\suse\scompiled\svwait/update\sversion,\sbecause\sit\smay\scause\sunexpected\s(or\srather\sunclear)\sflow-interruptions\swithin\ssingle\svwait's\sacross\smultiple\sinterpreters.\r\n\r\nLet\salone\sit\smay\snot\shelp\sin\ssuch\scase:\sI\sdon't\sknow\show\sgood\ssuch\sconstructs\swill\swork\swithin\sdifferent\sTEBCResume\ssegments.\r\nI'll\stry\sto\sexplain:\r\n<code><verbatim>\r\n\s\sI1\s->\svwait\s...\r\n\s\s\s\s\s...\sDoOneEvent\s->\sany\sevent\sof\sI2\r\n\s\s\s\s\s\s\s\sI2\s->\supdate\s...\r\n\s\s\s\s\s\s\s\s\s\s\s...\sDoOneEvent\s->\sI1-yield\sis\sdue\s\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s**BOOM\s(C\sstack\sbusy)\s**\r\n</verbatim></code>\r\nSo\sinstead\sof\sNRE-callback\sresp.\scompiled\sversion\sof\svwait/update\sI\scan\simagine\sa\snew\sinterp-state\slike\syieldInProgress,\swhich\scan\sfreeze\sexecution\sof\sthe\sinterpreter\s(yield\scallback\sTclNRCoroutineActivateCallback)\suntil\sthe\sC\scall\sstack\sof\sit\sgets\sthe\ssame\sstackLevel.\sSo\sit\smay\sbe\ssomething\slike\sthis:\r\n\r\n<code><verbatim>\r\nTEBCResume:\r\n\s\sI1\s->\svwait\s...\r\n\s\s\s\s\s...\sDoOneEvent\s->\sI1-yield\sis\sdue:\r\n\s\s\s\s\s\s\s\s\s\s\sif\sC\sstack\sis\sbusy:\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sset\sI1.yieldInProgress\sto\scurrent\scallBack\sand\sreturn\sTCL_YIELD.\r\n\s\s\s\s\s\s\s\s\s\s\s...\r\n\s\s\s\s\s...\sif\sI1.yieldInProgress\sadd\scallbacks\sand\sreturn\sto\sTEBCResume.\r\n\s\s<-\r\n\s\sexecute\syieldInProgress\scallbacks\s(we\scan,\sbecause\sinterp\s==\sI1\sand\sC-stack\sis\sclear)\r\n\s\scontinue\svwait-callbacks\s(e.\sg.\swait\sfurther\s/\stimeouts,\setc.).\r\n\r\n</verbatim></code>
J login sebres
J mimetype text/x-fossil-wiki
K cc592ec70de012dff030d61affb4b8d62da6cfb6
U sebres
Z 933122953cb10fe48a41c52f5fbba04a