Skip to content
Tcl Source Code Artifact [51d427ec57]
Login

Artifact [51d427ec57]

Artifact 51d427ec57361564f0087b9fa1ae070ba45d47f5799b44cec960c1b698d4ca0d:

Ticket change [51d427ec57] - Ticket [815e2468064b4324|815e246806] <i>tcl crash on channel thread transfer and fileevent writable in place</i> status still Pending with 3 other changes by sebres on 2018-06-12 11:42:30.
D 2018-06-12T11:42:30.391
J icomment I\stried\sto\stest\sthe\sfix\swithout\satomic\soperations\s(rewritten\satomic-defines\ssimilar\sthe\slast\ssection\sfrom\scurrent\sbranch\sif\sno\sTCL_THREADS\sdeclared,\sso\sas\s(++(p))\sand\s(--(p))).\r\n\r\nIt's\snot\sstable\sas\snon-atomic\s(sporadically\sproduces\spanic\s"Channel\sreleased\smore\sthan\spreserved").<br/>\r\n<b>So\sno\sway\swithout\s-\seither\satomic\sor\smutex</b>\s(which\sIMHO\sa\sbit\ssuperfluous\sfor\sincr/decr).\r\n\r\nPlease\sfind\senclosed\sbetter\s(faster)\stest-case\swithout\shand-brake\sin\sthe\sconsole\s(so\sit\sreproduces\svery\sfast\sa\ssegfault\sor\spanic\sin\soriginal\stcl\swithout\sthe\sfix,\sresp.\swithout\satomic\soperations\salso):\r\n<pre\sstyle="padding-left:10pt"><code>\r\nset\shandleproc\s{\r\n\s\s\s\sproc\shandle\s{chan}\s{\r\n\s\s\s\s\s\s\s\sglobal\sname\sother\scntr\r\n\s\s\s\s\s\s\s\sif\s0\s{;#\r\n\s\s\s\s\s\s\s\s\s\s\s\sif\s{$name\seq\s"master"}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sputs\s-nonewline\sM\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s{!([incr\scntr]\s%\s100)}\s{flush\sstdout}\r\n\s\s\s\s\s\s\s\s\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sthread::send\s$other\s{puts\s-nonewline\ss}\r\n\s\s\s\s\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\sif\s{!([incr\scntr]\s%\s50)}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sif\s{$name\seq\s"master"}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sputs\s-nonewline\s[expr\s{$cntr\s%\s2500\s?\s""\s:\s"\s--\s$cntr\\n"}]M\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sthread::send\s$other\s{puts\s-nonewline\ss}\r\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s\s};#\r\n\s\s\s\s\s\s\s\sif\s0\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\sthread::transfer\s$other\s$chan\r\n\s\s\s\s\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\sthread::detach\s$chan\r\n\s\s\s\s\s\s\s\s\s\s\s\s#thread::send\s$other\s[list\sthread::attach\s$chan]\r\n\s\s\s\s\s\s\s\s\s\s\s\sthread::send\s-async\s$other\s[list\sthread::attach\s$chan]\r\n\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s\sthread::send\s$other\s[list\sfileevent\s$chan\swritable\s[list\shandle\s$chan]]\r\n\s\s\s\s}\r\n}\r\n\r\neval\s$handleproc\r\nset\sname\smaster\r\nset\sother\s[thread::create]\r\n\r\nthread::send\s$other\s[list\sset\sname\sslave]\r\nthread::send\s$other\s[list\sset\sother\s[thread::id]]\r\nthread::send\s$other\s$handleproc\r\n\r\nset\snulldev\s[dict\sget\s{unix\s/dev/null\swindows\sNUL}\s\s$tcl_platform(platform)]\r\nset\schan\s[open\s$nulldev\sRDWR]\r\nhandle\s$chan\r\n\r\nvwait\sforever\r\n</code></pre>
J login sebres
J mimetype text/x-fossil-wiki
K 815e2468064b4324bc4b303b9bafd3ef92803c32
U sebres
Z 12f1e8f38184af176f6435e01327e2ac