HPE GreenLake Administration
Operating System - HP-UX
1835251
Members
2310
Online
110078
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
09-17-2001 10:46 AM
09-17-2001 10:46 AM
Next PID
How does Unix determine the PID for a new process?
I have an application that uses the PID as part of a log file name. The application processes output files and runs many times during a day and each run is a new process. It appears that it comes up with the same PID, sometimes within a day or two, and end up with the output of two runs combined in one log file. I would have thought that with a maximum PID of 65k, it would take much longer than that to come around to the same PID.
Jim
I have an application that uses the PID as part of a log file name. The application processes output files and runs many times during a day and each run is a new process. It appears that it comes up with the same PID, sometimes within a day or two, and end up with the output of two runs combined in one log file. I would have thought that with a maximum PID of 65k, it would take much longer than that to come around to the same PID.
Jim
But I'm feeling much better now........
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2001 11:05 AM
09-17-2001 11:05 AM
Re: Next PID
Hi Jim,
You are essentailly correct; PID's count up to 65535 and then recycle though low numbers (e.g. 1) are skipped and a test is done to see if the PID is in use. However, your filename creation may not be directly related to the PID value. It may simply test to see if such a file exists (e.g. the processes last temp file name) and use it if available. It is also possible that your are spawning many, many processes so that PID collision within a day or so is not unlikely.
You are essentailly correct; PID's count up to 65535 and then recycle though low numbers (e.g. 1) are skipped and a test is done to see if the PID is in use. However, your filename creation may not be directly related to the PID value. It may simply test to see if such a file exists (e.g. the processes last temp file name) and use it if available. It is also possible that your are spawning many, many processes so that PID collision within a day or so is not unlikely.
If it ain't broke, I can fix that.
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