tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Posix shared memory and mmap()

On Friday 15 January 2010 19:12:39 Joerg Sonnenberger wrote:

> > So why bother implementing Posix shared memory functions (shm_open and
> > shm_unlink), if the same can be achieved with mmap()?
> Because it might be more efficient. E.g. you can dramatically cut down
> on the involved locking if you know that the object is always in weired
> memory etc.

This overhead with locking, I assume it only occurs when you initially set up 
the shared object. Once the object is mapped, then the system knows it's in 
memory. If that's the case, then it shouldn't be much of an issue, because 
most applications set up shared memory IPC once, i.e. on startup and use it 
until terminated.

Home | Main Index | Thread Index | Old Index