"Venkateshwar" <venkateshwar.raman@xxxxxxxxx> wrote:
Is there anyway by which I can ensure that only one instance of a program is running? This program generates a
number and there is chance that it can be
called by 2 programs to generate number and there is a chance both can get same number.

"Instance of a program." Hmm. Technically, on an AS/400, there's never more than one "instance of a program" in memory at a time.
Of course, there could be many *activations* of a program 
in memory at a time, each with its own static and dynamic 
storage.
At any rate, I would imagine that all you should need to 
do is have it get an exclusive lock on something as soon 
as it starts executing, and release the lock just before 
it returns.
--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact copyright@midrange.com.

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.