HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Semaphores, Using Files and process control
Operating System - HP-UX
1833924
Members
3092
Online
110063
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
06-03-2005 04:10 AM
06-03-2005 04:10 AM
Semaphores, Using Files and process control
Since my thread on using multiple SYSLOGD processes is not going any where, I have the following situation. I have an application that has at least 6 concurrently executing programs that all write entries to a log file for that one instance (I can have 100 such instances running at the same time). In the current programming, the 6 processes execute a function called LOG_ERR that does a semop to get exclusive access to the common instance log file, opens, writes and closes the log file and finally does a semop to release exclusive access to the log file. The problem I have is that some of these processes are in the middle of a LOG_ERR and a signal is received that causes the same process to need to write another log entry but gets caught up in the queue of processes waiting on the semophore (for exclusive access) to be released. My question is this: How do I determine the current process that has control of the semophore? My logic is, if the process that has the current semaphore control (lock) is needing to make another entry (because of a interrupt) then that process does not need to lock again, just write.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2005 04:43 AM
06-03-2005 04:43 AM
Re: Semaphores, Using Files and process control
A semctl can use GETPID to get the PID of the last operation but sema4's for your application seems a little inappropriate since lockf() or fcntl() with a F_SETLKW command should be a perfect fit.
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