svn commit: r201546 - in head: . include lib/libc/gen
lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys
Renato Botelho
rbgarga at gmail.com
Wed Jun 16 12:24:03 UTC 2010
On Mon, Jan 4, 2010 at 11:37 PM, David Xu <davidxu at freebsd.org> wrote:
> Author: davidxu
> Date: Tue Jan 5 02:37:59 2010
> New Revision: 201546
> URL: http://svn.freebsd.org/changeset/base/201546
>
> Log:
> Use umtx to implement process sharable semaphore, to make this work,
> now type sema_t is a structure which can be put in a shared memory area,
> and multiple processes can operate it concurrently.
> User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open()
> to initialize a shared semaphore.
> Named semaphore uses file system and is located in /tmp directory, and its
> file name is prefixed with 'SEMD', so now it is chroot or jail friendly.
> In simplist cases, both for named and un-named semaphore, userland code
> does not have to enter kernel to reduce/increase semaphore's count.
> The semaphore is designed to be crash-safe, it means even if an application
> is crashed in the middle of operating semaphore, the semaphore state is
> still safely recovered by later use, there is no waiter counter maintained
> by userland code.
> The main semaphore code is in libc and libthr only has some necessary stubs,
> this makes it possible that a non-threaded application can use semaphore
> without linking to thread library.
> Old semaphore implementation is kept libc to maintain binary compatibility.
> The kernel ksem API is no longer used in the new implemenation.
>
> Discussed on: threads@
>
> Added:
> head/include/semaphore.h (contents, props changed)
> head/lib/libc/gen/sem_new.c (contents, props changed)
> head/lib/libthr/thread/thr_sem_new.c (contents, props changed)
> Deleted:
> head/sys/sys/semaphore.h
> Modified:
> head/ObsoleteFiles.inc
> head/include/Makefile
> head/lib/libc/gen/Makefile.inc
> head/lib/libc/gen/Symbol.map
> head/lib/libc/gen/_pthread_stubs.c
> head/lib/libc/gen/sem.c
> head/lib/libc/include/libc_private.h
> head/lib/libthr/pthread.map
> head/lib/libthr/thread/Makefile.inc
> head/lib/libthr/thread/thr_init.c
> head/lib/libthr/thread/thr_private.h
> head/lib/libthr/thread/thr_sem.c
> head/sys/kern/uipc_sem.c
> head/sys/sys/_semaphore.h
>
> Modified: head/ObsoleteFiles.inc
> ==============================================================================
> --- head/ObsoleteFiles.inc Tue Jan 5 02:06:05 2010 (r201545)
> +++ head/ObsoleteFiles.inc Tue Jan 5 02:37:59 2010 (r201546)
> @@ -14,6 +14,8 @@
> # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
> #
>
> +# 20100105: new userland semaphore implementation
> +OLD_FILES+=usr/include/sys/semaphore.h
Everythime I update my -CURRENT this file is installed again, and is
listed when i run make check-old, I think there is something wrong.
--
Renato Botelho
More information about the svn-src-all
mailing list