| > From reading the CMA documentation this error caused by CMA running into a
> "Foreign stack", one which CMA did not create. What I think is happening is
> when the MIR routine is called the routine is creating a MCC thread with its
> own stack and when CMA execute it find itself with this unknown stack. Have I
> got this right? Is there any way around this?
>
The current thread package used in MCC v1.0 and v1.1 can not mixed
with CMA in the same process: they are both two user mode library packages,
each of which assumes absolute control of thread stack space, thread scheduling,
AST handling, etc. NOTE: whenever callable-mcc is used in a process,
then mcc thread package creates a scheduler thread during a lib$initialize routine
even before your MAIN routine is entered. RMS i/o, SYS$QIOW vectors
are patched to revector to mcc i/o routines to issue the i/o request,
block the thread, resume the highest priority ready-thread etc... The
point to remember here is that once your executable image is linked with
"callable mcc" then its execution immediately and unconditionally uses
multiple threads.
The good news is that we are currently changing MCC to use CMA for both
the VMS and Ultrix platform. The work entails providing some jacketted
routines over cma to preserve the current srm interfaces and making
the rest of mcc "thread-safe". New development (and MCC development) will be encouraged
to use cma routines directly rather than the use the jacketted framework routines
which will move into obsolence someday. (And the cma interface is
likely to be changed a bit after the posix balloting...)
An alternative today (albiet with some risk and future conversion work) is to use the
"cma compatable (version fall 1989) framework routines" which
were not included into the srm because of we want developers to use cma
(but since it's not available yet and real work must get done...)
The routines for cma-like condition variables, mutexes, once, and thread context handling
are accessable in the mcc_kernel_shr. If you need these functions before
"mcc with cma" is available for prototyping work, etc and understand their
unsupported status, then I can provide the routine documentation.
Pete Burgess
|