Skip to main content

[archive] Threads And C$system

  • August 29, 2008
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 28 August 2008]

I am calling a compression utility to perform a save of user data. I need to have the exit status value from the process so i do not use the CSYS-ASYNC. The manual states that this will cause the cobol program to wait for the command execuited to finish.
So, I performed a paragraph in a thread and this paragraph did the call to c$system. Nevertheless, the main thread also does not continue until the command to the c$system has completed and I placed it into a thread as want to do things whilst this command is processing.
I make the presumption that maybe ALL threads are paused whilst c$system executes although I do not know why this would be, and the manual makes no reference to threads and c$system used together?
Does anyone know how I could do that I want to do using c$system?

1 reply

[Migrated content. Thread originally posted on 28 August 2008]

I am calling a compression utility to perform a save of user data. I need to have the exit status value from the process so i do not use the CSYS-ASYNC. The manual states that this will cause the cobol program to wait for the command execuited to finish.
So, I performed a paragraph in a thread and this paragraph did the call to c$system. Nevertheless, the main thread also does not continue until the command to the c$system has completed and I placed it into a thread as want to do things whilst this command is processing.
I make the presumption that maybe ALL threads are paused whilst c$system executes although I do not know why this would be, and the manual makes no reference to threads and c$system used together?
Does anyone know how I could do that I want to do using c$system?
The answer is that the runtime does not use operating system threads for portability reasons.

Because of this, when you turn control over to another program (such as through CALL C$SYSTEM), the runtime's thread switcher is blocked from executing until that program finishes.