.
D 2024-12-03T12:04:08.971
J icomment Time\sfor\ssome\sbackground/thoughts.\r\n\r\n##\sThe\sfull\sexplanation\r\n\r\nThe\sproblem\sis\sthat\swhen\sdestroying\san\sobject\sor\sclass,\sits\snamespace\sis\sdestroyed\s(this\sis\sthe\scentral\sentity\sof\severy\sTclOO\sobject)\sand\sthat\sin\sturn\striggers\sthe\sdestruction\sof\severy\scommand\swithin\sthe\snamespace\s(which\scan\sinclude\sother\sobjects).\sClasses\shave\sthe\sadditional\scomplexity\sthat\sthey\salso\sdestroy\severy\sdownstream\sentity\s(i.e.,\stheir\sinstances\sand\ssubclasses).\sThis\srecursive\sdestruction\scan\sblow\sout\sthe\sC\sstack;\sthe\sdepth\srequired\sto\sdo\sthis\sis\svariable,\sdepending\son\sthe\sactivation\srecord\ssizes,\sstack\ssize,\setc.\sand\sif\syou\sdon't\shit\sthe\sstack\slimit\sthen\swhat\swe\shave\sin\s8.6.15\sworks\sabsolutely\sfine.\sBut\sstack\ssizes\sare\snot\sinfinite,\sand\sit's\salways\spossible\sto\sfind\sa\slevel\sat\swhich\sany\ssystem\swill\sfail;\sthe\sparticular\svalues\sI\spicked\sworked\son\sthis\ssystem,\sbut\sI\smake\sno\sclaim\sof\suniversality\sunlike\swith\sthe\sgeneral\sform\sof\sthe\sproblem.\sI'd\srather\snot\sincrease\sthings\sto\s100\smillion\snested\sobjects,\sas\sthat\swill\sjust\smake\sfor\sa\shorribly\sslow\sset\sof\stests.\r\n\r\nThe\susual\sfix\sfor\sthis\ssort\sof\sthing\s(i.e.,\swhat\sis\sused\sin\s`Tcl_Obj`s\sdeletion\ssystem,\swhich\sfaced\sa\ssimilar\sproblem)\sis\sto\smaintain\sa\squeue\sof\sentities\sfor\sdestruction,\sand\sany\sattempt\sto\sdestroy\san\sentity\swhile\sdestruction\sis\songoing\sjust\sresults\sin\sthe\sitem\sbeing\squeued\s(the\stop\slevel\sdestruction\sprocesses\sthat\squeue).\sThis\sworks\sgreat\sfor\snested\sobjects,\sbut\s*doesn't\sfor\sclasses*;\sthe\sinstances\sof\sthe\sclass\s*must*\sbe\sdestroyed\sbefore\sthe\sclass\sgoes\sotherwise\sthe\srunning\sof\sthe\sdestructors\sgoes\sabsolutely\shaywire.\s(I\swas\svery\sannoyed\swhen\sI\sworked\sout\swhat\swas\sgoing\swrong\sthere.)\r\n\r\nIn\sgeneral,\s**the\sorder\sof\sdestruction\sis\sa\svery\ssensitive\sthing**;\swe\sreally\sdon't\swant\sto\schange\sthat\sbecause\sthat's\svery\sobservable\sby\suser\sscripts\s(and\sthings\slike\sTDBC\srely\son\sit\sa\slot).\r\n\r\n##\sSuggested\sform\sof\sfix\r\n\r\nHave\sa\squeue\sof\sdestruction,\sbut\swhen\sthe\sobject\sbeing\sdestroyed\sis\sa\sclass\sthat\sstill\shas\sactive\sdependent\sentities,\sinstead\sof\sit\sbeing\sdestroyed\sit\sshould\sinstead\sbe\sre-queued\sfor\slater\sprocessing.\r\n\r\nI'm\snot\sat\sall\ssure\sthat\sthe\splace\swhere\sI\sprocessed\sthe\sdestruction\squeue\sis\sthe\scorrect\sone.
J login dkf
J mimetype text/x-markdown
K 02977e0004c72049ed3324fe35f8634bfeede8e6
U dkf
Z 62fd0539120fdeb8a110b29e17bc04ec