If you are using an (unsupported) pre-Enterprise COBOL compiler, then I think the answer is pretty simple (and relatively well documented). See (for example),
http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igypg205/3.4 "You cannot run your COBOL program in more than one thread. If you start a COBOL application in a second thread, you get a software condition from the COBOL run time. You can run your COBOL programs in he initial process thread (IPT) or in one non-IPT that you create from a C or PL/I routine." You may *think* you have found a way to "trick" the COBOL environment into accepting a "threaded" environment, but I just don't think it is possible. Bottom-Line: Switch to a SUPPORTED COBOL compiler and use the THREAD compiler option. That's what it is there for <G> ""Michael Knigge"" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Steve, > > >Why are you fetching the routine more than once? Fetch > >it once and it stays there until the process ends. If > > Because I want the Prog to start always in its initial state. But ok, I > could do an INITIALIZE to all my WORKING STORAGE stuff. > > > >Is the COBOL program compiled with THREAD? In your > >multi-threaded application you will need this. [It > > No, it isn't. THREAD is only available with Enterprise COBOL and we don't > have this. But my application starts a "CALL-COBOL-Thread" that gets > notified by all other threads that a COBOL-Prog needs to be executed. So I > ensure that always the same Thread fetches and enters the COBOL-Prog. > > > >can still run in non-threaded apps, although it will > >be slower.] > > Slower is evil ;-> > > > I've also tried to use fork()/execl() and spawn() but all in vain. spawn() > and execl() always returned -1 and I don't know what I'm doing wrong :-( > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

