On Thursday, 05/02/2002 at 09:48ZE10, "Simon Coulter"
<shc@flybynight.com.au> wrote:

> I have an interesting problem.  A C program calls another C program in a
> batch job with ALWMLTTHD(*YES) specified.  The call is successful but on
> return to the caller, the calling program is blown out of the water and
> the entire job ends.  No unusual error messages are in the joblog.

Ensure the callee is compiled specifying ACTGRP(*CALLER).

IIRC, if you take all the defaults, CRTBNDC creates programs using ACTGRP
(*NEW).  When the CALLEE is activated, a new AG is created.  When the
CALLEE returns, its *NEW AG is destroyed.  Since you're in ALWMLTTHD(*YES)
process, the process comes down, too.  This is a safety net to prevent
thread unsafe operations, though it is admittedly a "big hammer."

FWIW, the granularity of the "effects" in this scenario has been adjusted
in later releases (only those threads that actually *used* anything in the
other activation group are terminated) in part to accomodate RPG/Java

However, if you can let your CALLEE run in the same AG as its caller,
you'll be better off.



Blair Wyman -- iSeries JVM -- (507) 253-2891
"I was born not knowing, and have had only a
little time to change that here and there."   -- Richard P. Feynman

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].