[TriLUG] anybody use pointers and shared memory?

John F Davis johndavi at us.ibm.com
Wed May 15 16:00:53 EDT 2002


Hello,

Please bear with me, notes doesn't handle replies very well.  I would
prefer to reply to your points after each paragraph, but it just aint gonna
happen.

I used the regular list, because the dev list seems to be dead.

But that's not my point...

I'm talking about completely seperate process's without any forked
relationship.   After I wrote this note, I talked to some other developers
and the resultant idea was that if one wanted to do what I want to do, then
they must allocate a large buffer pool in shared memory and then use some
custom routines to disperse the memory from this large buffer.  (jmalloc if
you will.)  I figured someone had written such routines already.  It sounds
like your SGI code does the same thing, but I'm looking for something open
sourced.

JD



Tanner Lovelace <lovelace at wayfarer.org>@trilug.org on 05/15/2002 03:49:01
PM

Please respond to trilug at trilug.org

Sent by:    trilug-admin at trilug.org


To:    trilug at trilug.org
cc:    dev at trilug.org
Subject:    Re: [TriLUG] anybody use pointers and shared memory?



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)

_______________________________________________
TriLUG mailing list
    http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ:
    http://www.trilug.org/~lovelace/faq/TriLUG-faq.html





More information about the TriLUG mailing list