summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2015-07-27 10:07:29 +0000
committered <ed@FreeBSD.org>2015-07-27 10:07:29 +0000
commit5008a9424b9438608187b7a9454757e3780b2a17 (patch)
tree9368a2f9ab7ec24858e1073deee7564d1b8a2f6a /contrib/llvm/lib/IR/Core.cpp
parentfd2045436d59dbe731ea35d1e046727d35c73461 (diff)
downloadFreeBSD-src-5008a9424b9438608187b7a9454757e3780b2a17.zip
FreeBSD-src-5008a9424b9438608187b7a9454757e3780b2a17.tar.gz
Add a futex implementation for CloudABI.
Summary: CloudABI provides two different types of futex objects: read-write locks and condition variables. There is no need to provide separate support for once objects and thread joining, as these are efficiently simulated by blocking on a read-write lock. Mutexes simply use read-write locks. Condition variables always have a lock object associated to them. They always know to which lock a thread needs to be migrated if woken up. This allows us to implement requeueing. A broadcast on a condition variable will never cause multiple threads to be woken up at once. They will be woken up iteratively. This implementation still has lots of room for improvement. Locking is coarse and right now we use linked lists to store all of the locks and condition variables, instead of using a hash table. The primary goal of this implementation was to behave correctly. Performance will be improved as we go. Test Plan: This futex implementation has been in use for the last couple of months and seems to work pretty well. All of the cloudlibc and libc++ unit tests seem to pass. Reviewers: dchagin, kib, vangyzen Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3148
Diffstat (limited to 'contrib/llvm/lib/IR/Core.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud