How to restrict execution of same class from two different consoles at same time?
Shailesh Sukare
Greenhorn
Joined: Sep 04, 2008
Posts: 4
posted
0
How to restrict execution of same class from two different consoles at same time???
I am facing one problem. I want only one instance of the class to be running on my OS. I have written one loader program and want to execute only one instance of loader at a time. If I execute the loader from one console and while the first loader is running I want to prevent execution of second loader from the another console.Is there any way to restrict the execution of same class from two different consoles.
[ September 05, 2008: Message edited by: Shailesh S. ]
[ September 05, 2008: Message edited by: Shailesh S. ] [ September 05, 2008: Message edited by: Bear Bibeault ]
Thanks,<br />Shailesh S.
David Balažic
Ranch Hand
Joined: May 15, 2008
Posts: 83
posted
0
You probably have to use a method as in all other languages.
For example creating a lock file in the filesystem. (Study the procedure carefully, to avoid common mistakes !)