Re: [PATCH] Lightweight userspace semaphores...

From: Ingo Molnar (mingo@elte.hu)
Date: Sat Feb 23 2002 - 10:03:14 EST


On Sat, 23 Feb 2002, Rusty Russell wrote:

> 1) Interface is: open /dev/usem, pread, pwrite.

i like the patch, but the interface is ugly IMO. Why not new syscalls? I
think these lightweight semaphores will become an important part of Linux,
so having their own syscall entries is the most correct interface,
something like:

  sys_sem_create()
  sys_sem_destroy()
  sys_sem_down()
  sys_sem_up()

/dev/usem is such an ... ioctl()-ish approach. It's a scalability problem
as well: read()/write() has (or can have) some implicit locking that is
imposed on the usem interface as well. It's a usage robustness issue as
well: chroot() environments that have no /dev directory will suddenly lose
a functionality of Linux. There is absolutely no problem with adding new
syscalls for things like this.

Plus sys_sem_create() should do some proper resource limit management,
pinning down an unlimited number of pages is bad.

        Ingo

-
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/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:50 EST