Skip to content
Tcl Source Code Artifact [8118f309ea]
Login

Artifact [8118f309ea]

Artifact 8118f309eaf631ace6eb1087cf99d9bfd2dab3ac:

Ticket change [8118f309ea] - Ticket [486399ffffffffff|486399ffff] <i>Panic on exit before all threads returned</i> status still Open with 4 other changes by ferrieux on 2009-05-07 03:27:28.
D 2009-05-07T03:27:28
J icomment Here's\sa\scopy\sof\sa\smessage\sI\ssent\sto\stclcore\sregarding\sthese\sissues:\n\nfromAlexandre\sFerrieux\s<[email protected]>\ntoTclCore\s<[email protected]>\ndateWed,\sMay\s6,\s2009\sat\s12:42\sAM\nsubjectFinalization\svs.\sExit\nmailed-bygmail.com\nhide\sdetails\s12:42\sAM\s(21\shours\sago)\n\nReply\n\nHi,\n\nAs\sexhibited\se.g.\sin\nhttps://sourceforge.net/tracker/?func=detail&aid=486399&group_id=10894&atid=110894\n,\sthe\sTcl\sfinalization\ssequence\sis\sa\scomplex\sthing.\n\nIn\sthis\sspecific\sbug,\sthe\sproblem\sinvolves\savoiding\sbad\sinteraction\sof\nsecond-class\sthreads\swith\sthe\smain\s(first-class)\sone\sduring\sthe\svery\nlast\ssteps\sof\steardown,\swhen\sthe\sground\sstarts\sto\sdissolve\sunder\neverybody's\sfeet.\nIn\sother\sinstances,\sit\scan\sbe\sargued\sthat\swe're\sdoing\sway\stoo\smuch\n"administrative"\scleanup\s(like\sfreeing\smemory)\sjust\sbefore\sexiting.\n\nNow\sa\ssimple\sapproach\sseems\sto\sbe\sviable:\smake\sa\sclear\sdistinction\nbetween\sthe\s[exit]\spath\sand\sfull\sfinalization\s(eg\sin\sembedded\nscenarios,\ssince\sDonal\sdislikes\sscenarii\s;-).\n\nThe\sidea,\sthen,\sis\sto\smake\sclearer\sin\sthe\scode\sthe\sdichotomy\sbetween\nthe\sexit\shandlers\sthat\sare\s"administrative"\s(meaning\sthey\shave\sno\neffect\soutside\sthe\sdying\sprocess)\sand\scan\sthus\sbe\sskipped\sin\sthe\n[exit]\scase,\sand\sthose\sthat\sare\sreally\scompulsory\sin\sall\scases\sbecause\nthey\shave\sside-effects\son\sthe\soutside\sworld,\sthese\sside-effects\sbeing\npart\sof\sa\sdocumented\sor\simplicit\scontract\sthat\swe\ssimply\scannot\sbreak.\nThen,\sfor\sthe\s[exit]\spath,\sjust\sdo\sthe\scompulsory\sones,\sand\scall\sthe\nOS's\sexit()\sfunction.\n\nQuestion:\scould\syou\shelp\sme\sdraw\sthis\sdichotomy\s?\n\nHere\sis\swhat\sI\shave\sspotted\sso\sfar:\n\n\s\s-\sprocess-wide\sexit\shandlers\sregistered\swith\sTcl_CreateExitHandler,\naka\s"early\sexit\shandlers"\s-->\scompulsory\n\n\s\s-\sper-thread\sexit\shandlers\s(freeing\smemory)\s-->\sskippable\sfor\s[exit]\n\nStill\sin\sthe\sgray\szone,\sis\sFinalizeIOSubsystem.\sI\sknow\sof\scases\swhere\nnot\scalling\sit\smight\shave\slong-ranging\seffects\s(like\sRST\ssent\son\sall\nnon-closed\ssockets),\sbut\ssince\sit\sdeals\swith\sper-thread/interp\nstructures\s(like\schannel\slists),\sit\sshould\seither\sbe\sentirely\sskipped\nor\sdone\sfor\sall\sthreads...\swhich\sis\sproblematic\sat\sexit\stime\sif\ssome\nthreads\sare\sblocked\sor\sin\san\suncontrolled\sstate.\n\nThanks\sin\sadvance\sfor\sany\sinsight\son\sthis,\n\n-Alex\n
J login ferrieux
J mimetype text/plain
J username ferrieux
K 486399ffffffffffffffffffffffffffffffffff
U ferrieux
Z f7c7c23635e08edba76f0ef492cdd734