Kbase P97305: How to create a procedure that doesn't take up 100% CPU
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/10/2011 |
|
Status: Verified
GOAL:
How to create a procedure that doesn't take up 100% CPU
GOAL:
How to write a batch process that waits for specific events to happen
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
FIX:
This can be achieved by wrapping the WAIT-FOR in a loop and adding the PAUSE 0 option, for example:
REPEAT :
IF [condition] THEN RUN [logic].
IF [exit condition] THEN LEAVE.
WAIT-FOR "CLOSE":U OF THIS-PROCEDURE PAUSE 0.
END.