HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sinlge Instance of the Application
Operating System - HP-UX
1832926
Members
3161
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2004 05:26 PM
10-21-2004 05:26 PM
Sinlge Instance of the Application
Hi,
I am having a C++ Application.
I wanted to make sure that its only one instance is active at a particular time.
Is there any System Call to do the same or other way to acheive the same?
Many Thanks
I am having a C++ Application.
I wanted to make sure that its only one instance is active at a particular time.
Is there any System Call to do the same or other way to acheive the same?
Many Thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2004 08:30 PM
10-21-2004 08:30 PM
Re: Sinlge Instance of the Application
I think it's your program that may look for this. When it starts, it should look for another instance. If one running, then exit immediately. That is done by many programs using lock files.
If you want a program to monitor, how would this one know which one to kill ? Or even if it is safe to kill ?
Regards,
Fred
If you want a program to monitor, how would this one know which one to kill ? Or even if it is safe to kill ?
Regards,
Fred
--
"Reality is just a point of view." (P. K. D.)
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2004 08:33 PM
10-21-2004 08:33 PM
Re: Sinlge Instance of the Application
Hi
Simple solution most programs use is to make a file like
/tmp/applicationPID containing the process id of this application.
If file exists give a message and exit until either file is manually removed or other copy of application stops.
Steve Steel
Simple solution most programs use is to make a file like
/tmp/applicationPID containing the process id of this application.
If file exists give a message and exit until either file is manually removed or other copy of application stops.
Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP