Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tcl_precision mutex

Closed / Accepted1077229fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2004-12-02 01:10:24
consider storing the shared
tcl_precision value as a
ProcessGlobalValue.
dgpplain2005-03-25 22:43:40
Logged In: YES 
user_id=80530


I'd like your comment on this,
and on the related idea of 
storing tcl_precision per-interp
instead of sharing app-wide.
kennykbplain2005-04-19 22:19:21
Logged In: YES 
user_id=99768

Storing tcl_precision per-interp rather than
process wide doesn't work, because Tcl_PrintDouble
doesn't take an interp as a parameter.  Alas.
dgp Ticket [1077229fff]: 1 change [History diff]2005-07-06 22:24:39
dgpplain2005-07-06 22:24:40
Logged In: YES 
user_id=80530


how about storing tcl_precision
per-thread rather than app-wide?

Almost seems that we have to do
that, or else the whole process
of formatting doubles is not
"thread-safe" in a rather important
sense.
dgpplain2005-07-07 23:59:22
Logged In: YES 
user_id=80530


ummm.... FWIW, Tcl_PrintDouble
*does* appear to accept an interp
argument.
dgpplain2005-07-08 00:01:08
Logged In: YES 
user_id=80530


...though T_PD must handle,
and most often sees, a value
of interp == NULL passed in.
dgpplain2005-07-08 00:07:24
Logged In: YES 
user_id=80530


Attached patch makes the
tcl_precision a per-thread value.

Advantage is that surprises like

    set tcl_precision 5
    <another thread sets tcl_precision to something else>
    puts $myDouble

are avoided.

Disadvantage is those misquided souls
who believe they want a different value
of tcl_precision that the default (0) now
have to set it in each thread, not just
once per app.

please review
dgpplain2005-07-08 00:07:26
File Added - 141223: 1077229.patch
dgp Closed ticket [1077229fff]. [History diff]2005-07-28 01:59:53
dgpplain2005-07-28 01:59:54
Logged In: YES 
user_id=80530


Committing updated patch to HEAD.
dgp Ticket [1077229fff]: 2 changes [History diff]2005-07-28 01:59:56
dgpplain2005-07-28 02:00:02
File Added - 143518: 1077229.patch
dgpplain2005-07-28 02:00:04
File Deleted - 141223:
Log in (anonymous is fine) to add a comment.

Attachments: