Tcl Source Code

View Ticket
Login
Ticket UUID: 1077229
Title: tcl_precision mutex
Type: RFE Version: None
Submitter: dgp Created on: 2004-12-02 01:10:24
Subsystem: 10. Objects Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-07-28 02:00:04
Resolution: Accepted Closed By: dgp
    Closed on: 2005-07-27 18:59:56
Description:
consider storing the shared
tcl_precision value as a
ProcessGlobalValue.
User Comments: dgp added on 2005-07-28 02:00:04:

File Deleted - 141223:

dgp added on 2005-07-28 02:00:02:

File Added - 143518: 1077229.patch

dgp added on 2005-07-28 01:59:54:
Logged In: YES 
user_id=80530


Committing updated patch to HEAD.

dgp added on 2005-07-08 00:07:26:

File Added - 141223: 1077229.patch

dgp added on 2005-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

dgp added on 2005-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.

dgp added on 2005-07-07 23:59:22:
Logged In: YES 
user_id=80530


ummm.... FWIW, Tcl_PrintDouble
*does* appear to accept an interp
argument.

dgp added on 2005-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.

kennykb added on 2005-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 added on 2005-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.

Attachments: