Skip to content
Tcl Source Code Artifact [6289cd5091]
Login

Artifact [6289cd5091]

Artifact 6289cd509162c4b257423b226abd7a93f7c6609b:

Ticket change [6289cd5091] - Ticket [1726873fffffffff|1726873fff] <i>Intermittent crash in threaded Tcl</i> status still Open with 4 other changes by vasiljevic on 2007-06-30 20:12:55.
D 2007-06-30T20:12:55
J icomment Logged\sIn:\sYES\s\nuser_id=95086\nOriginator:\sNO\n\nAh...\sI\ssee\sall\sthe\sproblems...\s\n\nYes\sthe\sTcl_FinalizeMutex/Condition\sare\sreally\s\nlacking\smaster\slocks.\sAnd\sthe\sRememberSyncObj()\nneeds\sto\scheck\sempty\sslots\sbefore\sre-allocating\nnew\stable.\sThis\sall\sis\strue.\n\nWhat\sI\shave\ssome\sproblems\swith\sis\sthe\spatch\s\nimplementation\sas\sit\sassumes\sthat\sForgetSyncObj()\ncan\sbe\scalled\sunprotected.\sI\sunderstand\sthat\sthis\nrelies\son\sthe\sfact\sthat\supdates\sof\san\schar*\sare\s\nsupposed\sto\sbe\satomic\sand\sthread-safe,\sright?\n\nI\sthink\sthat\screation/teardown\sof\ssync\sprimitivies\nis\snot\s(should\snot?)\sbe\sa\svery\sfrequent\soperation\nafter\sall.\sSimply\swrapping\sthe\sForgetSyncObj()\sin\na\sTclpMasterLock/Unlock\spair\sshould\sfix\sthe\nproblem\sand\sIMHO\snot\sintroduce\sany\ssignificant\nspeed\spenalties\soverall.\s\sYes,\swe\smay\syield\sthe\s\nthread\sat\sthat\spoint,\scorrect,\sbut\sthen\sagain,\s\nteardowns\s\sare\srare\sand\snormally\shappen\sduring\s\nfinalization\stimes,\sso\sno\sbig\sdeal.\n\nOne\smay\sask:\swhy\sdo\swe\sneed\sthat\s\nRemember/Forget\sthingy\safter\sall?\s\nI\scannot\sanswer\sthat\squestion\snow,\s\nbut\sIMHO\swe\sdon't.\sThe\sTcl\sfinalization\s\nis\sscrewed\sanyways\swhen\sit\scomes\sto\sthreads\nso\sby\somitting\sthe\sRemeber/Forget\scalls\nno\sreal\sharm\swould\sbe\sdone.\sStill\sthe\scode\sis\nthere\sand\ssomebody\sput\sit\sthere\son\ssome\spurpose\nand\sI\swould\snot\slike\sto\squestion\sthat\spurpose\shere.\nWe\smust\sgo\sto\score-list\sto\sstraighten\sthis\sout.\s\n\nFinally,\sI\salways\sprefer\sstability\svs.\sperformance.\s\nBy\sproperly\slocking\sthe\sForgetSyncObj()\swe\smay\nsacrifice\ssome\sspeed\syet\sbuy\sourselves\ssimpler\s\nand\smore\sreliable\scode\s(no\sassumptions\sabout\s\natomicity\sof\sinteger/pointer\soperations).\s\n\nUnless\ssomebody\spulls\sout\ssome\svery\spersuading\nreason\swhy\swe\sshould\snot\sdo\sit\sthis\sway,\splease\s\nspeak\snow.\sA\sgood\sexample\swould\sbe\ssome\sreal\s\nworld\smetrics\sabout\sapplication\sslowdown\swith\s\nmaster\slocks\sin\splace\svs.\sunlocked\scase\s(as-is\snow).\n\nCheers,\nZoran\n
J login vasiljevic
J mimetype text/plain
J username vasiljevic
K 1726873fffffffffffffffffffffffffffffffff
U vasiljevic
Z 3713dec2200b1091a1748e245ea68a12