On Wed, Oct 08, 2008 at 11:20:37AM +0100, Alan Cox wrote:
quoted text > > That is racy when multi threaded because shmat() doesn't replace, so you
> > would need to munmap() inbetween and someone else could steal the area
> > then. Yes you could stick a loop around it. It could livelock.
> > No, it's not a good interface I would advocate.
>
> You could just use pthread mutexes in your application. The rôle of the
malloc() can call mmap, so that would require putting a mutex around
each malloc(). Good luck finding them all.
quoted text > kernel is not to provide nappies for people who think programming is too
> hard but to provide services that can be used to build applications.
Outsourcing kernel locking to user space is not the way to go.
-Andi
--
ak@linux.intel.com
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [PATCH, v3] shmat: introduce flag SHM_MAP_NOT_FIXED , Andi Kleen , (Wed Oct 8, 4:02 am)