: <i>portable Tcl_CreateThread inherit of fp settings</i> plus 8 other changes
by
.
D 2013-07-02T13:02:26.731
J closedate 2456476.04336494
J closer jan.nijtmans
J comment The\sunix\simplementation\sof\sTcl\sthreading\ssupport\r\nis\sbuilt\son\sthe\spthread\slibrary,\sand\sthe\sroutine\r\npthread_create()\sis\sat\sthe\score\sof\sall\sTcl\sthread\r\ncreation\son\sunix.\r\n\r\npthread_create()\sdocuments\show\sit\smanages\sthe\r\ninitialization\sof\sthe\sfloating\spoint\senvironment\sin\r\nthe\screated\sthread:\r\n\r\n"The\s\sfloating-point\s\senvironment\s\sshall\s\sbe\sinherited\sfrom\sthe\screating\r\n\s\s\s\s\s\s\sthread."\r\n\r\nThis\sis\sa\svery\suseful\sdefault\sbehavior\sfor\sprograms\r\nperforming\smulti-threaded\scalculations,\skeeping\sall\r\nthreads\scomputing\sin\sa\sconsistent\sway.\r\n\r\nEmpirically,\swe\sdo\snot\ssee\sthis\sdesirable\sbehavior\r\nfrom\sTcl_CreateThread()\son\sWindows.\s\sIn\sparticular,\r\nwhen\sthe\smaster\sthread\sis\scomputing\susing\r\n80-bit\sextended\sprecision\scomputations,\sall\r\nthreads\screated\sby\sT_CT()\sdo\stheir\scomputations\r\nusing\sonly\sthe\sdefault\s64-bit\sprecision\soperations.\r\nEven\scode\sexplicitly\swritten\susing\sC\s"long\sdouble"\r\nvariables\sgets\sonly\s64-bit\sprecision\sfunction\swhen\r\nrun\sin\sa\sTcl\snon-master\sthread.\s\sThe\sconsequence\r\nis\sthat\scomputed\sresults\sare\snot\sportable.\r\n\r\nTcl_CreateThread()\stakes\san\sargument\sfor\sa\sthread\r\ninitialization\sprocedure,\sso\sthose\sprograms\sthat\scare\r\nabout\sthis\sdetail\shave\sthe\sability\sto\suse\sthat\sroutine\r\nto\sworkaround\sthis\sproblem.\s\sThe\sdisadvantage\sis\sthat\r\nthe\scode\sto\squery\sand\sset\sthe\sfloating\spoint\senvironment\r\nis\sa\snonportable\smess,\sdepending\son\shardware\sand\r\nOS\sand\scompiler\sand\sother\sdetails.\s\sCoding\sa\sportable\r\nsolution\sto\sforcing\sfp\senvironment\sinheritence\sis\sa\sbig,\r\nthorny\sproblem.\s\sIt's\sexactly\sthe\skind\sof\sportability\r\nchore\sthat\sprograms\srely\son\sthe\sTcl\slibrary\sto\ssolve\r\nin\sother\sscenarios.\r\n\r\nIt's\sa\stall\sorder,\sbut\sI'd\slike\sit\sif\sTcl_CreateThread()\saimed\r\nat\smaking\sthe\sfp\senvironment\sinheritance\sof\spthread_create()\r\na\scross-platform\sfeature\sas\smuch\sas\spossible.
J icomment Already\simplemented\sin\s8.6
J login jan.nijtmans
J mimetype text/plain
J resolution Fixed
J severity Minor
J status Closed
K 3567063fffffffffffffffffffffffffffffffff
U jan.nijtmans
Z aa6603e5d8939f1a3c5c162bd06901d6