E
Elliot
Hi
I'm working with an older version of Micro Focus in Windows - Object
COBOL (32-bit) Version 4.0.38 and I compile individual program into
"gnt" or "int" files rather than distributing linked exe files.
When I run programs doing sequential reads or writes on large files
I'm getting %100 utilization on single core machines and %50 on my own
dual core machine.
I may be running many of these processes on the same machine in the
near future and I need to find a way to reduce the CPU load.
Based on my experience with other languages I had thought that the
high numbers were due to not returning control to the OS system
periodically so that it could handle outstanding events.
I was delighted when I found references to the CBL_YIELD_RUN_UNIT and
PC_WIN_YIELD MF library routines which are supposed to and I quote
from the MF documentation " enable Windows to process any outstanding
events and gives any other programs in the system a chance to run. If
this is not done, Windows appears to freeze until the COBOL program
next yields control."
I've tried both of these routines and they don't seem to be doing
anything in this case; utilization is still at %50 on my machine.
I've also tried the following code which only works with my "ints" and
gives a routine not found error message with "gnts"
move 100 TO SLEEP-TIME
CALL "COB32API"
$SET CASE
CALL WINAPI "Sleep" USING BY VALUE SLEEP-TIME
$SET NOCASE
In any case it seems to be at best a partial solution. When the "sleep
" command executes utilization goes to around %35 and then goes right
back to %50.
Does anyone know if it's possible to solve this problem in Micro
Focus. It must be common enough in many Cobol applications running in
Windows
Thanks in advance
Elliot
I'm working with an older version of Micro Focus in Windows - Object
COBOL (32-bit) Version 4.0.38 and I compile individual program into
"gnt" or "int" files rather than distributing linked exe files.
When I run programs doing sequential reads or writes on large files
I'm getting %100 utilization on single core machines and %50 on my own
dual core machine.
I may be running many of these processes on the same machine in the
near future and I need to find a way to reduce the CPU load.
Based on my experience with other languages I had thought that the
high numbers were due to not returning control to the OS system
periodically so that it could handle outstanding events.
I was delighted when I found references to the CBL_YIELD_RUN_UNIT and
PC_WIN_YIELD MF library routines which are supposed to and I quote
from the MF documentation " enable Windows to process any outstanding
events and gives any other programs in the system a chance to run. If
this is not done, Windows appears to freeze until the COBOL program
next yields control."
I've tried both of these routines and they don't seem to be doing
anything in this case; utilization is still at %50 on my machine.
I've also tried the following code which only works with my "ints" and
gives a routine not found error message with "gnts"
move 100 TO SLEEP-TIME
CALL "COB32API"
$SET CASE
CALL WINAPI "Sleep" USING BY VALUE SLEEP-TIME
$SET NOCASE
In any case it seems to be at best a partial solution. When the "sleep
" command executes utilization goes to around %35 and then goes right
back to %50.
Does anyone know if it's possible to solve this problem in Micro
Focus. It must be common enough in many Cobol applications running in
Windows
Thanks in advance
Elliot