John Polstra wrote:
> If you want the "BSD way" you should probably create a 0-length
> temporary file somewhere and use the flock(2) system call on it.  The
> file itself isn't important; it's just something to lock.

I don't see any reason to do system calls just because I want to do an
atomic operation (i.e aquire/release a lock).

I found some really good code (:-)) in
/usr/src/libexec/rtld-elf/i386/lockdflt.c that seems to do what I want.
It's more the "i386"-way than the BSD-way. Maybe I havn't been thinking
enough but wouldn't this lock mechanism be a good choice to use for
mmaped:memory accessed by multiple processes? 

In lock_create the lock is aligned to CACHE_LINE_SIZE. Why is that
important?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to