Skip to content
Tcl Source Code Artifact [73f31cf278]
Login

Artifact [73f31cf278]

Artifact 73f31cf2783258e85e3295382264beab79489524:

Ticket change [73f31cf278] - Ticket [659131ffffffffff|659131ffff] <i>development targets: Complete pthreads?</i> status still Open with 4 other changes by vasiljevic on 2002-12-28 21:06:47.
D 2002-12-28T21:06:47
J icomment Logged\sIn:\sYES\s\nuser_id=95086\n\n1.\s\s\nSemaphores\sare\sok.\sSo\sare\scritical\ssections\sand\srecursive\s\nlocks.\sBut,\swhat\sI\swant\sto\sachieve\sis\s*simplicity*.\sThread\s\nprogramming\shas\sbecome\spretty\ssimple\sthanks\sto\sthe\sTcl\s\ncompartment\sthread\smodel.\sIf\syou\slook\sat\sthe\stpool.tcl\ssource\s\nyou\swon't\sfind\sa\ssingle\scondition\svariable\sor\sa\smutex.\sYet,\s\nrelatively\scomplex\simplementation\sof\sthreadpool\sis\sdone\swith\s\nTcl\salone\sand\sit\sis\sonly\sabout\s20%\sslower\sthan\sthe\sC-level\s\nimplementation.\sFurthermore,\sthe\sTcl\simplementation\scosted\s\nabout\s2\sdays\sdevelopment.\sThe\sC-one\stook\s10\sdays.\sSo,\s\neconomically\sspeaking,\sthe\sTcl\sversion\sis\sthe\sclear\swinner.\s\n\s\nNeedles\sto\ssay\sthat\sa\ssemaphore\scan\sbe\sdone\sin\spure\sTcl\s\nwith\sa\smutex\sand\sa\scondition\svariable,\swhich\sthe\sthreading\s\nextension\salready\ssupplies.\s\s\n\s\n2.\sI\swill\sinclude\sthe\skeyed-list\sdatastructure\sin\s2.6.\s\n\s\n3.\sIt\swill\sjust\shave\sthe\srefcount\sof\s0\smeaning\sthat\scaller\sof\s\nsuch\s"non-preserved"\sthread\smay\snever\sknow\swether\sthe\s\nthread\sis\sstill\sthere\sfor\sthe\snext\soperation.\sBut,\sit\swill\snot\s\s\nexit\sw/o\sbeing\stold\sso\swith\sa\s"thread::release"\s\n\s\n4.\sI\swill\sshortly\srevamp\sthe\scond/mutex\sTcl\sAPI\ssupport.\sWatch\s\nfor\sthe\snew\sTIP.\sThis\sway\sthe\sAPI\swill\sbe\smore\spowerful\sand\s\s\nyou\scan\sget\smany\snew\sinfo/statistics\sabout\sthe\smutex\setc.\s\n\s\n5.\sInherently\simpossible\sby\spthread\salone.\s\n\s\n6.\sThere\sis\sno\ssuch\scommand\sin\sthe\sthread\spackage.\sThere\s\nis\showever\sthread::wait\sand\sit\sis\sdescribed.\s\n\s\n7.\sThere\sis\salready\sthread::eval\swhich\sevaluates\sa\sscript\sunder\s\nthe\smutex,\seither\simplicit\sor\sexplicit\sone.\s\n\s\s\s\n8.\sI\sthink\sthat\sthe\smessage\spassing,\stogether\swith\schannel\s\ntransfer\sand\sdetach/attach\sallows\sone\sto\simplement\salmost\s\nany\stask.\s\s\n\s\n9.\sAs\sa\sscript\sprogrammer,\syou\scan\ssafely\sdo\sthe\s"exec"\s\s\nfrom\sthe\sMT\sTcl\sshell.\sThe\sunderlying\simplementation\swill\s\ndo\sthe\sright\sthing.\s\n
J login vasiljevic
J mimetype text/plain
J username vasiljevic
K 659131ffffffffffffffffffffffffffffffffff
U vasiljevic
Z 0a515b37fad7d2889031e050b4373d4f