[TriLUG] anybody use pointers and shared memory?
Tanner Lovelace
lovelace at wayfarer.org
Wed May 15 15:49:01 EDT 2002
On Wed, 2002-05-15 at 15:30, John F Davis wrote:
> Hello
>
> I know how to use shared memory between processes via shmget and shmat, but
> I'm not an expert on their use. (I've used it for simple flat structures.)
> Anybody have any experience using them with something similar to malloc'd
> pointers? For instance, if I want to dynamically allocate data that is
> shared, do I have to use shmget/shmat in lieu of malloc?
>
> Yes, I realize each process has their own heap so malloced pointers shared
> between process's are meaningless, but is their some simple technique for
> dynamic shared memory?
>
> I realize I'm not very clear on this. Its easier to describe the problem
> more concisely with code, but I don't have any code written at this point
> because I am just thinking out loud.
> JD
Hi John,
Could you explain a little more about what you're doing? If you're
trying to share memory between two processes that were created from
the same original process using fork, you should probably look
at the mm library (http://www.engelschall.com/sw/mm/). If you're
trying to share between two completely separate processes, however,
then mm won't help you.
It sounds like what you need is basically SGI Arenas, which, as
far as I know, aren't available under linux. (Actually, the
SGI performer team did a port of it to linux but last I heard
it wasn't :-( open source.) I was looking for something like
this a while back for completely disparate processes and didn't
have any luck finding anything. If you do come up with something,
I'd be interested in hearing about it.
BTW, I've cc'd the dev list for this. This sounds like it is
more properly a question for that list. (Although, if anyone
on the main list wants to answer it, please don't let me discourage
you.)
Tanner
--
Tanner Lovelace | lovelace at wayfarer.org | http://wtl.wayfarer.org/
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
GPG Fingerprint = A66C 8660 924F 5F8C 71DA BDD0 CE09 4F8E DE76 39D4
GPG Key can be found at http://wtl.wayfarer.org/lovelace.gpg.asc
--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
Have we sent the "Don't shoot, we're pathetic" transmission yet?
Commander John Crichton (Farscape)
More information about the TriLUG
mailing list