Skip to content
Tcl Source Code Artifact [ef74dbd722]
Login

Artifact [ef74dbd722]

Artifact ef74dbd72249d9341ae1edaeccb71d0689524d1c230ecfc55f199c18d50f7390:

Ticket change [ef74dbd722] - Ticket [893f8cc5db3ba8bd|893f8cc5db] <i>Nested mutexes following TIP 509</i> status still Closed with 5 other changes by jan.nijtmans on 2025-09-26 07:18:42.
D 2025-09-26T07:18:42.289
J closedate 2460944.80465612
J closer jan.nijtmans
J icomment Thanks!\r\n\r\nSo\swe\shave\s2\sdogma's:\s"thy\sshall\snot\suse\srecursive\smutex"\sand\s"thy\sshall\suse\sa\ssingle\slock\swithin\sa\scompare-and-modify\soperation".\sHere\swe\shave\san\sexample\swhere\sthose\stwo\srules\sare\sconflicting.\sIn\ssome\ssituations\sthe\sfirst\srule\sis\smore\simportant,\sin\sother\ssituations\sthe\ssecond\sone.\r\n\r\nThat\salso\smeans\swe\shave\sa\svalid\suse-case\sfor\srecursive\smutexes.\sFor\ssome\smore\scomplicated\scompare-and-modify\soperations\sit\smight\sbe\snot\sso\seasy\sto\simplement\sit\swithout\sa\srecursive\smutex.\sThis\sone\sis\squite\seasy,\sso\sI\stend\sto\sagree\swith\sboth\sAshok\sand\sSergey\sthat\sit's\sbest\sto\schange\stclEncoding.c.\sThis\sway\swe\sdon't\shave\sto\sbother\swith\srecursive\smutexes\sany\smore\sin\sthe\score\s(but\sit\smight\sbe\suseful\sfor\smore\scomplicated\ssituations\sin\sextensions).\r\n\r\nSo,\swe\scould\simplement\san\sinternal\sTclMutexStrictLock()\sfunction\swhich\sdoes\sthe\ssame\sas\sTcl_MutexLock(),\sexcept\sit\spanics\swhen\sit\sis\scalled\srecursively.\sIn\sorder\sto\sdo\sthat\swe\sstill\sneed\sa\sInterlocked\sfunction\sto\sretrieve\sthe\s"thread"\sfield,\sin\sorder\sto\sdetermine\sthat.\sSo\swe\sdon't\ssave\sanything\sat\sall\scompared\sto\sjust\susing\sTcl_MutexLock()\severywhere.\sI\sdon't\sthink\sit's\sworth\sit,\sneither\sto\sexport\sthis\sfunction\sas\sTcl_MutexStrictLock().\sIt\swould\sbe\seven\sless\sworth\sto\sduplicate\sall\smutex\sfunctions\sin\sa\snon-recursive\sand\sa\srecursive\svariant.\r\n\r\nLet's\stalk\sabout\sthis\snext\smeeting.
J login jan.nijtmans
J mimetype text/x-fossil-wiki
K 893f8cc5db3ba8bd6bed80ce89a0a75c6088a37c
U jan.nijtmans
Z 8881fa3421ab41c5c8f8fc4cae375fb3