Unnamed Fossil Project

Check-in [da55461f83]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add comment explaining why thread safety was not added to _tenpowers_.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: da55461f83b50497c395221de2ec935996b42a3f
User & Date: dgp 2013-04-29 17:41:21
Context
2013-05-01
16:37
Eliminate the global variables mp_precision and mp_epsilon. check-in: 03168a19fe user: dgp tags: trunk
2013-04-29
17:41
Add comment explaining why thread safety was not added to _tenpowers_. check-in: da55461f83 user: dgp tags: trunk
17:34
No need to use zcopy() for _one_ and _zero_. check-in: 9c4e3b42ca user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/zmath.h.

369
370
371
372
373
374
375














376
377
378
379
380
381
/*
 * constants used often by the arithmetic routines
 */
extern HALF _zeroval_[], _oneval_[], _twoval_[], _tenval_[];
extern ZVALUE _zero_, _one_, _ten_;















extern ZVALUE _tenpowers_[2 * BASEB];	/* table of 10^2^n */
extern HALF *bitmask;		/* bit rotation, norm 0 */

#endif

/* END CODE */






>
>
>
>
>
>
>
>
>
>
>
>
>
>






369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
/*
 * constants used often by the arithmetic routines
 */
extern HALF _zeroval_[], _oneval_[], _twoval_[], _tenval_[];
extern ZVALUE _zero_, _one_, _ten_;

/* Note the shared use of a global _tenpowers_ array by all threads creates
   the possibility of overlapping initialization of it by mulitple threads.
   As the initialization is constructed, this does not appear to be able to
   compute incorrect table entries.  It merely consumes greater effort and
   leaks more memory than is necessary.

   An attempt was made to make a single initialization pass by one master
   thread on startup, but that's not a good idea because the on-demand
   initializations currently in place make sure we only init the entries
   in the table we actually need to perform a requested calculation.
   Since the cost to add another entry to the table increases (exponentially?)
   as the table fills, the ability to avoid filling the entries we do not
   need is a practical necessity.
*/
extern ZVALUE _tenpowers_[2 * BASEB];	/* table of 10^2^n */
extern HALF *bitmask;		/* bit rotation, norm 0 */

#endif

/* END CODE */