HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Semaphores and processes
Operating System - HP-UX
1825776
Members
1961
Online
109687
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
Go to solution
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
11-06-2002 03:12 AM
11-06-2002 03:12 AM
HI,
What is the difference between semaphores and processes? How are they dependent on one another? when do semaphores occur?
How do I check for the number of semaphores running?
Thanks
What is the difference between semaphores and processes? How are they dependent on one another? when do semaphores occur?
How do I check for the number of semaphores running?
Thanks
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 03:28 AM
11-06-2002 03:28 AM
Solution
Hi
look at sar -m for the semaphore activity or get glance plus.
Fromm www.docs.hp.com search on semaphores
Overview of Semaphore Parameters
System V IPC semaphores are used mainly to keep processes properly synchronized to prevent collisions when accessing shared data structures. Their use in software tends to be complex, so many programmers use alternate means of control where practical.
Semaphore Operations
The semget() system call allocates an array containing a specified number of semaphores (see HP-UX Reference entry semget(2)). Assigning an array with only one semaphore in the set is usually the most sensible for keeping programs reasonably simple. Subsequent semaphore operations are performed atomically on the entire array; individual semaphores in the array are manipulated by an array of semaphore operations (see semop(2) ). semctl() is used to ascertain or change a semaphore's permissions, change time, or owner (see semctl(2)).
Semaphores are typically incremented by a process to block other processes while it is performing a critical operation or using a shared resource. When finished, it decrements the value, allowing blocked processes to then access the resource. Semaphores can be configured as binary semaphores which have only two values: 0 and 1, or they can serve as general semaphores (or counters) where one process increments the semaphore and one or more cooperating processes decrement it. To prevent undetectable overflow conditions, the kernel imposes a maximum value limit beyond which semaphores cannot be incremented. This limit, defined by the semvmx kernel parameter, must not exceed the maximum value of an unsigned integer (65535). Semaphores are not allowed to have negative (less than zero) values.
Semaphore Undo Operations
It may occasionally be necessary when errors occur, a process must abort, a process dies, etc., to change one or more semaphores to a new or previous value. This is called undoing a semaphore. Since the value of any semaphore when such conditions occur is unpredictable, the system enforces a limit on how much the value of a semaphore can change any undo operation. This limit is defined by the semaem kernel parameter.
For more information about System V IPC semaphore operation, consult an advanced UNIX programming text such as Advanced UNIX Programming by Marc J. Rochkind, Prentice-Hall, Inc., ISBN 0-13-011800-1.
Semaphore Limits
Configurable kernel parameters are available to limit the number of sets of semaphores that can exist simultaneously on the system and the total number of individual semaphores available to users that can exist simultaneously on the system. A fixed limit on the number of semaphores that can exist in a set (500) is not configurable.
Steve steel
look at sar -m for the semaphore activity or get glance plus.
Fromm www.docs.hp.com search on semaphores
Overview of Semaphore Parameters
System V IPC semaphores are used mainly to keep processes properly synchronized to prevent collisions when accessing shared data structures. Their use in software tends to be complex, so many programmers use alternate means of control where practical.
Semaphore Operations
The semget() system call allocates an array containing a specified number of semaphores (see HP-UX Reference entry semget(2)). Assigning an array with only one semaphore in the set is usually the most sensible for keeping programs reasonably simple. Subsequent semaphore operations are performed atomically on the entire array; individual semaphores in the array are manipulated by an array of semaphore operations (see semop(2) ). semctl() is used to ascertain or change a semaphore's permissions, change time, or owner (see semctl(2)).
Semaphores are typically incremented by a process to block other processes while it is performing a critical operation or using a shared resource. When finished, it decrements the value, allowing blocked processes to then access the resource. Semaphores can be configured as binary semaphores which have only two values: 0 and 1, or they can serve as general semaphores (or counters) where one process increments the semaphore and one or more cooperating processes decrement it. To prevent undetectable overflow conditions, the kernel imposes a maximum value limit beyond which semaphores cannot be incremented. This limit, defined by the semvmx kernel parameter, must not exceed the maximum value of an unsigned integer (65535). Semaphores are not allowed to have negative (less than zero) values.
Semaphore Undo Operations
It may occasionally be necessary when errors occur, a process must abort, a process dies, etc., to change one or more semaphores to a new or previous value. This is called undoing a semaphore. Since the value of any semaphore when such conditions occur is unpredictable, the system enforces a limit on how much the value of a semaphore can change any undo operation. This limit is defined by the semaem kernel parameter.
For more information about System V IPC semaphore operation, consult an advanced UNIX programming text such as Advanced UNIX Programming by Marc J. Rochkind, Prentice-Hall, Inc., ISBN 0-13-011800-1.
Semaphore Limits
Configurable kernel parameters are available to limit the number of sets of semaphores that can exist simultaneously on the system and the total number of individual semaphores available to users that can exist simultaneously on the system. A fixed limit on the number of semaphores that can exist in a set (500) is not configurable.
Steve steel
If you want truly to understand something, try to change it. (Kurt Lewin)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 03:46 AM
11-06-2002 03:46 AM
Re: Semaphores and processes
Hi,
A process is the instance of a running program. Semaphores are used to keep processes properly synchronized when accessing shared data structures. So if one process is writing to an area and another process attempts to do the same, a sempahore will block the second process.
Semaphores are used when accessing shared resources, like shared memory, or withing the kernel to access global resources like the page table on multiprocessor systems.
You can view semaphores using "ipcs -sb", look for the NSEMS (number of semaphores) in the last column.
Regards,
James.
A process is the instance of a running program. Semaphores are used to keep processes properly synchronized when accessing shared data structures. So if one process is writing to an area and another process attempts to do the same, a sempahore will block the second process.
Semaphores are used when accessing shared resources, like shared memory, or withing the kernel to access global resources like the page table on multiprocessor systems.
You can view semaphores using "ipcs -sb", look for the NSEMS (number of semaphores) in the last column.
Regards,
James.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP