Math in processes
Well, the problem with IEEEBase in particular is that tasks using it need to
preserve floating point registers when system interrupts occur, so I think
the library allocates some extra space in the library structure for them. If
your subtask and your main task both use the same instance of IEEEBase, they
may conflict with each other. Also, the IEEE library OpenLibrary() vector
sets up the math coprocessor for your task in a task-specific way. (Sorry,
I'm definately hand-waving here from memory of Mike Sinz and Randell Jesup
talking about this elsewhere.)
Why is it such a problem to call OpenLibrary() from the subtask? If the
problem is the use of externs, get my "amiproc" utility routines; these
routines duplicate the near data section of the main task for a subtask,
assuming the main task was linked with cres.o. This allows both the main
task and the subtask to have their own private copy of IEEEBase as an extern.
We have just released the V6.55 patch to SAS/C, and amiproc is included in
there in the SC:EXTRAS drawer. I also distributed it a few months ago, and
it should be around someplace on aminet.
–Doug