|
"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 anumber and there is chance that it can becalled 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 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 [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.