HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- what is a shared memory mapped file?
Operating System - HP-UX
1827806
Members
2261
Online
109969
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
06-18-2001 12:07 PM
06-18-2001 12:07 PM
What are the differences between shared memory, shared memory mapped files, and shared libraries?
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2001 02:18 PM
06-18-2001 02:18 PM
Solution
Hi Byron,
Shared memory is just what is sounds like. An area of memory that can be shared among processes. The typical method is a group of processes agree on a protocol for building a 'key' usually using the ftok function.
Then a process creates a shared memory segment
using shmget with IPC_CREAT set. This process can also set the permissions as to who can read and write to this segment. The processes actually attach to the segment via the shmat system call.
man shmget, ftok, shmctl, shmat, shmdt for details.
Memory mapped files are an extension of this and use the mmap system call to completely map a disk based file to an area of shared memory. Once that is done, all the standard file i/o operations read, write, etc. work except that they are writing to memory and thus are very fast. This is typically used to store lookup tables and scratchpad files for related processes. Man mmap for details.
Shared libraries enable many processes that can be totally unrelated to use a single set of instructions (text) and thus save memory on a machine-wide basis. For example, the printf function's instructions might be shared by hundreds of processes. This sharing is possible because the instructions (text) do not change; if a shared library module also includes data (and the vast m ajority do) then
each process gets it own copy of the data space while sharing text space.
Hope this clears it up a bit, Clay
Shared memory is just what is sounds like. An area of memory that can be shared among processes. The typical method is a group of processes agree on a protocol for building a 'key' usually using the ftok function.
Then a process creates a shared memory segment
using shmget with IPC_CREAT set. This process can also set the permissions as to who can read and write to this segment. The processes actually attach to the segment via the shmat system call.
man shmget, ftok, shmctl, shmat, shmdt for details.
Memory mapped files are an extension of this and use the mmap system call to completely map a disk based file to an area of shared memory. Once that is done, all the standard file i/o operations read, write, etc. work except that they are writing to memory and thus are very fast. This is typically used to store lookup tables and scratchpad files for related processes. Man mmap for details.
Shared libraries enable many processes that can be totally unrelated to use a single set of instructions (text) and thus save memory on a machine-wide basis. For example, the printf function's instructions might be shared by hundreds of processes. This sharing is possible because the instructions (text) do not change; if a shared library module also includes data (and the vast m ajority do) then
each process gets it own copy of the data space while sharing text space.
Hope this clears it up a bit, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2001 02:46 PM
06-18-2001 02:46 PM
Re: what is a shared memory mapped file?
Thanks, very good explanation. points comming. Please see follow up question on shared libraries to be posted soon.
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
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