<i>Nested mutexes following TIP 509</i> status still Open with 3 other changes
by
.
D 2025-09-18T11:51:39.532
J icomment <blockquote>>\sI\sam\spretty\ssure\saccessing\sthe\sthread\sand\scounter\sfields\soutside\sof\sany\slocks\sor\smemory\sbarriers\scan\sresult\sin\sstale\svalues\sbeing\sread\swith\sthe\scaller\serroneously\sthinking\sit\sis\sholding\sthe\slock\swhen\sit\sisn't\sand\sforegoing\sexecuting\sthe\s`pthread_mutex_lock`.</blockquote>\r\n\r\nI\sdon't\sthink\sso,\sand\seven\swith\saggressive\soptimization\slevel\sthe\scompiler\swouldn't\sgenerate\sthe\scode\sdoing\sthat.\sHowever\sI\scan\simagine\snecessity\sfor\svolatile\sdeclarations\sfor\ssome\svars.\r\n\r\nWhat\sdoesn't\schange\smy\sopinion\sabout\srecursive\smutexes.\r\n\r\n<blockquote>>\sCan\swe\sfix\sthis\susing\satomic\soperations?\sSomething\slike\s[./info/10bcfc0e125e9575|this]</blockquote>\r\n\r\nOr\slike\sin\s[./info/a1c84c80695cce88|this]\scommit?\sIt\suses\snative\satomic\sfunctions.\sAlso\sit'd\snot\sneed\sC11\sor\sC23\s(I\sported\sthat\satomic\sfacilities\sinitially\sfrom\snginx,\swhere\sthey\sappeared\sdozen\syears\sbefore\sC11).\r\n\r\nAnyway\shaving\sthat\sinterlocked\sfacilities\sin\sTcl\swould\sdefinitely\sprovide\smore\sbenefits\s(I\smissed\sit\soften\sin\score\stcl\sfor\satomic\sincr/decr\sreference\scounters\sin\sstructures\sused\sacross\sthreads,\slike\sin\sthat\sencoding\scommit).\sOften\sone\sdoesn't\sneed\smutex\sat\sall\s(where\sis\sno\slock\s-\sthere\sis\sno\swait).
J login sebres
J mimetype text/x-fossil-wiki
K 893f8cc5db3ba8bd6bed80ce89a0a75c6088a37c
U sebres
Z 59c9207030f8ccf6df61b5c7503a4045