- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shared memory
Operating System - HP-UX
1755664
Members
3863
Online
108837
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
Discussions
Discussions
Forums
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
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-04-2008 02:25 PM
тАО11-04-2008 02:25 PM
hello all,
i have problem with shared memory.
we have to create shared memory of about more than 700mb. and it looks like when creating it with shmget() command it is created as a contiguous block.( which i am not sure).
so my question is when we create shared memory will it be created as contiguous. if it is there a way i can make to create non contiguous for the same key value.
or is there a way i can create shared memory dynamically for the same key.
please give your thoughts
thanks in advance.
i have problem with shared memory.
we have to create shared memory of about more than 700mb. and it looks like when creating it with shmget() command it is created as a contiguous block.( which i am not sure).
so my question is when we create shared memory will it be created as contiguous. if it is there a way i can make to create non contiguous for the same key value.
or is there a way i can create shared memory dynamically for the same key.
please give your thoughts
thanks in advance.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2008 02:57 PM
тАО11-04-2008 02:57 PM
Re: shared memory
When you call shmget() it will create a shared memory virtual object. Such an object is assigned a virtual address range (the start of which is returned via shmat() calls).
Being a single virtual object -- um... it rather *must* be virtually contiguous. (How precisely would you find the other parts of the segment? There is no "shmat_again()" interface or anything like it). If what you want is a shared memory segment using holes in your virtual address space but created in a single call -- there is no such thing and frankly, I wouldn't expect any enhancement request for such an interface to be fulfilled. (If you really want this kind of thing -- just use MAP_SHARED mmap() with either MAP_ANONYMOUS or a temporary file or something).
There is zero guarantee that the physical memory when assigned to the object is contiguous or not.
There is zero guarantee (barring use of MPAS, but then only for the Private virtual address assigned on shmat() calls) that subsequent objects created via other shmget() [or mmap(), etc.] calls are virtually contiguous.
Being a single virtual object -- um... it rather *must* be virtually contiguous. (How precisely would you find the other parts of the segment? There is no "shmat_again()" interface or anything like it). If what you want is a shared memory segment using holes in your virtual address space but created in a single call -- there is no such thing and frankly, I wouldn't expect any enhancement request for such an interface to be fulfilled. (If you really want this kind of thing -- just use MAP_SHARED mmap() with either MAP_ANONYMOUS or a temporary file or something).
There is zero guarantee that the physical memory when assigned to the object is contiguous or not.
There is zero guarantee (barring use of MPAS, but then only for the Private virtual address assigned on shmat() calls) that subsequent objects created via other shmget() [or mmap(), etc.] calls are virtually contiguous.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2008 03:27 PM
тАО11-04-2008 03:27 PM
Re: shared memory
hello thanks for info.
i have one clarification though, so when i create with mmap then it will create the memory not in one contiguous block right ..?
and can we share this block of memory created with mmap be shared among process.
thanks
i have one clarification though, so when i create with mmap then it will create the memory not in one contiguous block right ..?
and can we share this block of memory created with mmap be shared among process.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2008 04:30 PM
тАО11-04-2008 04:30 PM
Solution
No, each call to mmap() will be a contiguous virtual object. The difference is that you can make multiple mmap() calls to share a single underlying file between processes (so the data can live beyond a single process and the mapped ranges don't have to be contiguous even though the data is).
MAP_SHARED|MAP_FILE will mmap a file range for a given offset and size, use that within each process.
If you don't want to use file backing -- MAP_ANONYMOUS will use RAM to back the mmap -- but these can only be shared among a process and its descendants, and will not live beyond the last mmap'er [so if all the processes quit -- any data is lost. Fine if that's your intention, but worth pointing out].
man 2 mmap for full details -- there's quite simply a lot of details to cover that it would be pointless to repeat here.
MAP_SHARED|MAP_FILE will mmap a file range for a given offset and size, use that within each process.
If you don't want to use file backing -- MAP_ANONYMOUS will use RAM to back the mmap -- but these can only be shared among a process and its descendants, and will not live beyond the last mmap'er [so if all the processes quit -- any data is lost. Fine if that's your intention, but worth pointing out].
man 2 mmap for full details -- there's quite simply a lot of details to cover that it would be pointless to repeat here.
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP