2000-12-05 08:07:50

by Peter.Ronnquist

[permalink] [raw]
Subject: shared memory, mmap not recommended?

Hello,

In a recent posting Linus Torvalds mentioned
(http://marc.theaimsgroup.com/?l=linux-kernel&m=97598683318724&w=2) :

> (otherwise I'll just end up disabling shared mmap - I doubt anybody really
uses it anyway, but it would be more polite to just support it).

I was thinking about using mmap for shared mememory in my program, but now I
am reconsidering.
Is the System V or Posix mechanism for shared memory a better(it will be
supported in 2.4) choice?

(I am not subscribed to the mailing list so please CC your eventual reply)

BR
Peter R?nnquist
Software Engineer
Nokia Home Communications
email: [email protected]


2000-12-05 08:15:12

by Peter Samuelson

[permalink] [raw]
Subject: Re: shared memory, mmap not recommended?

[Linus]
> > (otherwise I'll just end up disabling shared mmap - I doubt anybody
> > really uses it anyway, but it would be more polite to just support
> > it).

[Peter R?nnquist]
> I was thinking about using mmap for shared mememory in my program,
> but now I am reconsidering. Is the System V or Posix mechanism for
> shared memory a better(it will be supported in 2.4) choice?

Linus was talking about shared mmap on a file in an smbfs filesystem.
Rather different from what you are talking about. For regular shared
memory, shared mmap should be OK if you actually need backing store
(i.e. the state you are sharing is persistent). Often this is not the
case, in which case POSIX shm might be best.

Peter

2000-12-05 08:33:06

by Peter.Ronnquist

[permalink] [raw]
Subject: RE: shared memory, mmap not recommended?


> [Linus]
> > > (otherwise I'll just end up disabling shared mmap - I
> doubt anybody
> > > really uses it anyway, but it would be more polite to just support
> > > it).
>
> [Peter R?nnquist]
> > I was thinking about using mmap for shared mememory in my program,
> > but now I am reconsidering. Is the System V or Posix mechanism for
> > shared memory a better(it will be supported in 2.4) choice?
>
> [Peter Samuelson]
> Linus was talking about shared mmap on a file in an smbfs filesystem.
> Rather different from what you are talking about. For regular shared
> memory, shared mmap should be OK if you actually need backing store
> (i.e. the state you are sharing is persistent). Often this is not the
> case, in which case POSIX shm might be best.
>

I see, thanks a lot for the clarification.

BR
Peter R?nnquist