Date: Wed, 16 Jun 2010 09:16:36 -0300 From: Renato Botelho <rbgarga@gmail.com> To: David Xu <davidxu@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201546 - in head: . include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys Message-ID: <AANLkTikDxeZcZEc8t1dZvvkToUrK1v_Gfm5F9L9oX3Gr@mail.gmail.com> In-Reply-To: <201001050237.o052bxEd061444@svn.freebsd.org> References: <201001050237.o052bxEd061444@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 4, 2010 at 11:37 PM, David Xu <davidxu@freebsd.org> wrote: > Author: davidxu > Date: Tue Jan =A05 02:37:59 2010 > New Revision: 201546 > URL: http://svn.freebsd.org/changeset/base/201546 > > Log: > =A0Use umtx to implement process sharable semaphore, to make this work, > =A0now type sema_t is a structure which can be put in a shared memory are= a, > =A0and multiple processes can operate it concurrently. > =A0User can either use mmap(MAP_SHARED) + sem_init(pshared=3D1) or use se= m_open() > =A0to initialize a shared semaphore. > =A0Named semaphore uses file system and is located in /tmp directory, and= its > =A0file name is prefixed with 'SEMD', so now it is chroot or jail friendl= y. > =A0In simplist cases, both for named and un-named semaphore, userland cod= e > =A0does not have to enter kernel to reduce/increase semaphore's count. > =A0The semaphore is designed to be crash-safe, it means even if an applic= ation > =A0is crashed in the middle of operating semaphore, the semaphore state i= s > =A0still safely recovered by later use, there is no waiter counter mainta= ined > =A0by userland code. > =A0The main semaphore code is in libc and libthr only has some necessary = stubs, > =A0this makes it possible that a non-threaded application can use semapho= re > =A0without linking to thread library. > =A0Old semaphore implementation is kept libc to maintain binary compatibi= lity. > =A0The kernel ksem API is no longer used in the new implemenation. > > =A0Discussed on: threads@ > > Added: > =A0head/include/semaphore.h =A0 (contents, props changed) > =A0head/lib/libc/gen/sem_new.c =A0 (contents, props changed) > =A0head/lib/libthr/thread/thr_sem_new.c =A0 (contents, props changed) > Deleted: > =A0head/sys/sys/semaphore.h > Modified: > =A0head/ObsoleteFiles.inc > =A0head/include/Makefile > =A0head/lib/libc/gen/Makefile.inc > =A0head/lib/libc/gen/Symbol.map > =A0head/lib/libc/gen/_pthread_stubs.c > =A0head/lib/libc/gen/sem.c > =A0head/lib/libc/include/libc_private.h > =A0head/lib/libthr/pthread.map > =A0head/lib/libthr/thread/Makefile.inc > =A0head/lib/libthr/thread/thr_init.c > =A0head/lib/libthr/thread/thr_private.h > =A0head/lib/libthr/thread/thr_sem.c > =A0head/sys/kern/uipc_sem.c > =A0head/sys/sys/_semaphore.h > > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc =A0 =A0 =A0Tue Jan =A05 02:06:05 2010 =A0 =A0 = =A0 =A0(r201545) > +++ head/ObsoleteFiles.inc =A0 =A0 =A0Tue Jan =A05 02:37:59 2010 =A0 =A0 = =A0 =A0(r201546) > @@ -14,6 +14,8 @@ > =A0# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS= last. > =A0# > > +# 20100105: new userland semaphore implementation > +OLD_FILES+=3Dusr/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. --=20 Renato Botelho
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikDxeZcZEc8t1dZvvkToUrK1v_Gfm5F9L9oX3Gr>