General Issues

src/main

General changes.
eval.c:
make asym const char * const and change the declaration for install and WrongArgCount to preserve the const.
Short cut symbols are write-once/quasi-constants.
The R_...Symbol objects defined in main.c and declared in Defn.h are write-once. These are set in SymbolShortcuts() in names.c.
The following are also quasi constants.
Assigned to just once. Make sure only one thread invokes that routine by having the initialization do it and then spawn new threads. (I.e. have main do everything to bootstrap the system.)
R_tmp;			    /* Temporary Value */
R_NaN;			    /* NaN or -DBL_MAX */
R_PosInf;		    /* IEEE Inf or DBL_MAX */
R_NegInf;		    /* IEEE -Inf or -DBL_MAX */
R_NaInt;		    /* NA_INTEGER */
R_NaReal;		    /* NA_REAL */
R_NaString;		    /* NA_STRING */
R_BlankString;	
errno
Remove the explicit declaration of errno in Defn.h. POSIX threads redefines this as a thread-specific value.
R_FunTab in names.c appears to be possible as const FUNTAB R_Funtab []
Also, elements of a FUNTAB are constant.
Prefix each field with a const.
errors.c
jump_to_next_level needs an Evaluator
onintr(), error(), errorcall()
Compute their own version of the evaluator from the thread specific information. onintr() Register a default EVALUATOR for the signal handling thread.
Should inError be evaluator specific.
scan.c
Static variables, etc. need to be aggregated.
optimize.c
Fortran code can compute its own evaluator rather than engage in passing arguments to it.
Note that the do_fmin() routine doesn't appear to need the evaluator!
graphics.c and graphics.h
Problem with changing GNewPlot to have an evaluator argument. Header file ordering problem.
graphics.c and Graphics.h
Make the graphics device DevDesc carry information about the associated evaluator. This is accessible via the R_GET_GRAPHICS_EVALUATOR macro.
I used a macro to handle recordGraphicOperations() and to add an Evaluator argument to each such call. The actual routine is now named RecordGraphicOperations(). Other people's code may need to be recompiled if it references this symbol.
source.c
Remove the extern for R_ConsoleIob.
Memory management.
Centralized or not.
names.c
IS R_SymbolTable global across threads or local to a thread?
asFunction, asCommon in coerce.c
Added Evaluator as argument. Minimal (2 or 3) caller list.
dstruct.c & mkCLOSXP()
Added evaluator as argument. Called in do_function() in eval.c and and do_asfunction() in coerce.c.
util.c
isFree never gets called by anyone.
buitin.c
switchList can be made static(?)
coerce.c
coerceVector needs to have Evaluator argument. ~130 calls need to be changed. Macro needed.
install() needs to have an Evaluator argument. ~330 calls affected.
array.c
All allocation, etc. should have the evaluator associated with it.

src/library/

Only eda/ and mva/ have object code.
eda seems fine.
Must check rsort is mt-safe.
mva
Only non-local symbols are generated by the compiler.

regex

Use the routines in the system library (libc).
Better chance of them being thread-safe.

unix

macintosh

windows


Duncan Temple Lang <duncan@research.bell-labs.com>
Last modified: Fri Oct 23 20:25:19 EDT 1998