www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/07/27/05:36:25

Message-Id: <3.0.32.19990727113224.0117d950@pop.xs4all.nl>
X-Sender: diep AT pop DOT xs4all DOT nl
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Tue, 27 Jul 1999 11:32:25 +0100
To: pgcc AT delorie DOT com
From: Vincent Diepeveen <diep AT xs4all DOT nl>
Subject: Re: mmap
Mime-Version: 1.0
Reply-To: pgcc AT delorie DOT com

To allocate more than 32 mb shared memory you cannot use
IPC_SHARED from shmget either, also not implemented in linux.

There is however a work around invented by me that works:

First get kernel 2.2.x other kernels really don't work unless
u want to work using a huge file with mmap (and shared anonymous,
so without using that file doesn't work with mmap).

Then echo to the kernel:

echo 100000000 > /proc/sys/kernel/shmmax

Then allocate with shmget something with IPC_PRIVATE.

Correct you won't be able to use that for other processes,
as it's allocated private memory.

However you can get the segmentnumber from it.
then attach to that with shmat.

Now you have to find a way to transfer that segmentnumber
to the other processes.
If that's done then in other processes you only need shmat

The easiest way share the segmentnumber 
is to allocate a shared memory region smaller than
4mb, like a few bytes, where you put this number in,
as memory blocks smaller than 4mb you can definitely allocate
shared using shmget.


At 09:16 AM 7/26/99 -0700, you wrote:
>
>I have a program in which a number of executables use an mmap'ed file
>to share memory. This used to work fine, but we updated to Redhat ver
>5.2, and now the changes made by one process are no longer seen by the
>others.
>
>I am using the MAP_FIXED flag--the mmap'ed memory contains absolute
>pointers.
>
>The program has two possible interfaces, an X interface and a console
>interface. Everything appears to work okay when using the X interface.
>It's under the console interface that the problem appears.
>
>Any ideas? Is mmap() different?
>
>Sincerely
>
>
>Gordon Stone
>Technical Support
>Aptech Systems, Inc
>23804 S.E. Kent-Kangley RD
>Maple Valley, WA 98038
>425-432-7855 voice
>425-432-7832 fax
>gordon AT aptech DOT com
>
>
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019