Revision tags: release/9.0.0, release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
f4213b90 |
| 25-Sep-2010 |
David Xu <davidxu@FreeBSD.org> |
To support stack unwinding for cancellation points, add -fexceptions flag for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellatio
To support stack unwinding for cancellation points, add -fexceptions flag for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellation point, it also makes it possible that other functions can be cancellation points in libraries without having to be rewritten in libthr.
show more ...
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0 |
|
#
1a0fda2b |
| 04-Mar-2010 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
IFH@204581
|
#
4c1c132b |
| 18-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
preserve errno when processing error cases.
|
#
764ce7ce |
| 15-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Also call sem_module_init in sem_close to initialize mutex with some attributes.
|
#
41e16053 |
| 13-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Return SEM_FAILED instead of NULL, though there are same, but the SEM_FAILED is more suitable name. In function, sem_close(), always set errno on error.
|
#
323d80a0 |
| 07-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Don't forget to use fourth argument if O_CREAT is set in argument oflag. The fourth specifies initial value for the semaphore.
|
#
9199c09a |
| 06-Jan-2010 |
Warner Losh <imp@FreeBSD.org> |
Merge from head at r201628.
# This hasn't been tested, and there are at least three bad commits # that need to be backed out before the branch will be stable again.
|
#
523a738f |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
More cleanup, remove _libc prefix because libthr no longer has stubs referencing them.
|
#
d802aa25 |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Don't check has_waiters twice, inline some small functions. performance result on my machine: mutex Elapsed: 902115 us; per iteration: 90 ns. semaphore Elapsed: 958780 us; per iteration: 95 ns.
|
#
9b0f1823 |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
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
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@
show more ...
|
#
4c1c132b |
| 18-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
preserve errno when processing error cases.
|
#
764ce7ce |
| 15-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Also call sem_module_init in sem_close to initialize mutex with some attributes.
|
#
41e16053 |
| 13-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Return SEM_FAILED instead of NULL, though there are same, but the SEM_FAILED is more suitable name. In function, sem_close(), always set errno on error.
|
#
323d80a0 |
| 07-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Don't forget to use fourth argument if O_CREAT is set in argument oflag. The fourth specifies initial value for the semaphore.
|
#
9199c09a |
| 06-Jan-2010 |
Warner Losh <imp@FreeBSD.org> |
Merge from head at r201628.
# This hasn't been tested, and there are at least three bad commits # that need to be backed out before the branch will be stable again.
|
#
523a738f |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
More cleanup, remove _libc prefix because libthr no longer has stubs referencing them.
|
#
d802aa25 |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
Don't check has_waiters twice, inline some small functions. performance result on my machine: mutex Elapsed: 902115 us; per iteration: 90 ns. semaphore Elapsed: 958780 us; per iteration: 95 ns.
|
#
9b0f1823 |
| 05-Jan-2010 |
David Xu <davidxu@FreeBSD.org> |
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
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@
show more ...
|