- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- IPC's - shared memory, semaphores and messages.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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-30-2008 04:45 PM
тАО09-30-2008 04:45 PM
IPC's - shared memory, semaphores and messages.
i know there are 3:
shared memory, semaphores and messages,
why do they exist?
when are they used?
how are they used?
who do they use?
please let me know.
Thanks.
do you know a link to know more about it?
:0)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2008 06:14 PM
тАО09-30-2008 06:14 PM
Re: IPC's - shared memory, semaphores and messages.
With shared memory, you can share data by just loads/stores.
Semaphores are how you can also synchronize processes.
And you can also send messages to other processes.
Some links:
http://docs.hp.com/en/5187-2783/ch10s09.html
http://docs.hp.com/en/TKP-90202/ch06.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 01:50 AM
тАО10-01-2008 01:50 AM
Re: IPC's - shared memory, semaphores and messages.
ipcs(1) ipcs(1)
NAME
ipcs - report status of interprocess communication facilities
SYNOPSIS
ipcs [-mqs] [-abcopt] [-C core] [-N namelist]
DESCRIPTION
ipcs displays certain information about active interprocess
communication facilities. With no options, ipcs displays information
in short format for the message queues, shared memory segments, and
semaphores that are currently active in the system.
What is semaphore?
A semaphore is a type of Interprocess communication resource used for synchronization and mutual exclusion between any two asynchronous processes.
why?when?who?when?
Semaphores are used to cap the number of accesses to a given resource to a maximum number.
For example (and this is not a good example), if you have a multithreaded application, where threads are reading a file, you could create a semaphore to make sure that only 5 threads could read from the file at any given time. If there were 5 threads reading the file at some point and time, and another (6th) thread wanted to read the file, the semaphore would block access until one of the other 5 was finished.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 06:17 AM
тАО10-01-2008 06:17 AM
Re: IPC's - shared memory, semaphores and messages.
For threads, you would typically use mutexes and condition variables. So just replace thread by process above. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 02:17 PM
тАО10-01-2008 02:17 PM
Re: IPC's - shared memory, semaphores and messages.
The word "semaphore" derives from the Greek word for "flag" or "signal". As such, it is a variable used to control access to some common resource: a file; a piece of shared memory, etc.
A semaphore holds a zero or positive count that denotes the number of a resource that is available. One speaks of "P" and "V" operations to "dePlete" and "reVive" the count. Semaphores implement "locks" to resources.
A "P" operation decrecemnts a resource count. IF the count is zero, the process attempting to do the operation is suspended (waits). A "V" operation increcemnts the semaphore count, allowing another waiting process to resume execution. A binary semaphore (i.e one with states (counts) of only 0 and 1) implements a simple "lock" to a resource.
Semaphores form the basis for any multi-threading environement. WIthout them, it would be a city without traffic lights!
Regards!
...JRF...