Skip to main content

Hello, i'm trying to overcome the acu threads limitations (for example starting c$socket server in an acu thread blocks the parent thread) by using the Windows threading API, by doing this:

1 - start a cobol program

2 - from this program call a c++ dll of mine that does an acu_initv()

3 - call again this dll and call a cobol program with acu_cobol() from a new thread created with CreateThread from the Windows API

4 - call again this dll and call another cobol program with acu_cobol from another new thread created

Everything is fine up to point 3. But with point 4 I get memory corruption. If in 4 I call the same program of 3, doing a display upon console, then it does the display only once, but the memory doesn't get corrupted. My guess is that there is some kind of shared memory between the runtimes and I can't start more than 1 cobol program at time.

Is there a way of achieving my goal or not?

Thank you.

Luca

Hello, i'm trying to overcome the acu threads limitations (for example starting c$socket server in an acu thread blocks the parent thread) by using the Windows threading API, by doing this:

1 - start a cobol program

2 - from this program call a c++ dll of mine that does an acu_initv()

3 - call again this dll and call a cobol program with acu_cobol() from a new thread created with CreateThread from the Windows API

4 - call again this dll and call another cobol program with acu_cobol from another new thread created

Everything is fine up to point 3. But with point 4 I get memory corruption. If in 4 I call the same program of 3, doing a display upon console, then it does the display only once, but the memory doesn't get corrupted. My guess is that there is some kind of shared memory between the runtimes and I can't start more than 1 cobol program at time.

Is there a way of achieving my goal or not?

Thank you.

Luca

Hi Luca,

The ACUCOBOL runtime is not thread safe, so as far as I know, what you're trying to do is not supported.

Philip Saenz
Micro Focus Product Support | Micro Focus, an OpenText Company