[lkml]   [2002]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Lightweight userspace semaphores...
> 	fd = sem_initialize();
> mmap(fd, ...)
> ..
> munmap(..)
> which gives you a handle for the semaphore.

fd = open("/dev/shm/sem....");
mmap(fd, ...)


That lets the kernel decide what it wants to do and provide as the back
end. It allows you to think about things like mremap and growing/shrinking
the object. And finally /dev/sem looks suspiciously like a quick tweak
to /dev/shm..

> And make the initial mmap() only do a limited number of pages, so that
> people don't start trying to allocate tons of memory this way.-

If it uses the /dev/shm world then anyone running a kernel with the new
patches for resource accounting is still safe, and anyone else is still
simply going to find their shm areas hitting swap under extreme load (which
is ideal)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.098 / U:6.552 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site