Skip to Content
Former Member
Nov 13, 2007 at 09:28 AM

Locking one program if another is running ....


Hi experts,

I have came across a situation, before executing one program, i have to check weather other program is running or not.

Lets say I have 2 programs, program 1 and program 2.

1. If I want to run the pg 1, in foreground, I have to check weather prg 2 is running either in foreground or in background. If it is running in both the conditions, I have to raise an error message at the time of execution of prg 1 itself.

2. If I want to scedule the prg 1. At the time of its execution in background, it should check that prg 2 is not running at all (neither foreground nor background). If the prg 2 is running, prg 1 should, either wait till prg 2 gets executed or get rescheduled.

Please provide me your valuable suggestions.


Ganesh V Khumse.