Re: Fine-grained locking for POSIX local sockets (UNIX domain sockets)

From: Andrew Gallatin <gallatin_at_cs.duke.edu>
Date: Fri, 12 May 2006 16:41:11 -0400 (EDT)
Daniel Eischen writes:
 > On Wed, 10 May 2006, David Xu wrote:
 > > One of the problems to implement it is that atomic operations,
 > > if there are multiple integer needs to be updated by kernel,
 > > userland maybe gets an inconsistent result, the way to avoid the
 > > problem is using two generation numbers.
 > >
 > > http://gsu.linux.org.tr/~mpekmezci/kernelapi/unitedlinux/arch/x86_64/kernel/vsyscall.c.html
 > > check do_vgettimeofday(struct timeval * tv):
 > >
 > > Another problem is how you tell userland the address of the kernel
 > > page ? do you use fixed address or tell it via program headers like
 > > the PT_TLS set by kernel, check /usr/src/lib/libc/gen/tls.c.
 > 
 > Can you not make a simple pseudo device driver and mmap the page?

In addition to this linux vsyscall, there is the MacOSX/Darwin
commpage.  The map machine-specific implementations of atomic
operations, bcopy, bzero, spinlocks, pthread_getspecific, etc into a
common page mapped into userspace applications. The also do a (mostly)
syscall-free gettimeoday this way.

See http://fxr.watson.org/fxr/source/osfmk/ppc/commpage/?v=xnu-792

Obviously, we could not take the code due to APSL infection (unless
Apple were to donate it), but it is something else to look at.

Drew
Received on Fri May 12 2006 - 18:41:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:55 UTC