Olivier Houchard
27fb1bc00f
ck: Reimplement a few libc headers, to make CK build when compiling in the
...
FreeBSD kernel.
9 years ago
Samy Al Bahra
e693cb9afe
ck_*lock: Migrate all locking primitives to lock / unlock.
...
This only affects RMO. This adds stricter semantics for critical section
serialization. In addition to this, asymmetric synchronization primitives will
now provide load ordering with respect to readers.
This also modifies locked operations to have acquire semantics
(they're there for elision predicates, and this doesn't impact them
in any way). There are several performance improvements included in this
as well (redundant fence was removed from days of wanting to support
Alpha).
10 years ago
Samy Al Bahra
554e2f0874
whitespace: Strictly conform to C namespacing rules.
10 years ago
Samy Al Bahra
0dfd145aa6
whitespace: Update Copyright messages.
10 years ago
Samy Al Bahra
d6ba2a6273
whitespace: Sweeping whitespace changes.
...
Removing trailing whitespaces and newlines.
10 years ago
Samy Al Bahra
f3539396c2
*lock: Simply use compiler barrier on initialization.
11 years ago
Samy Al Bahra
176dfce5c3
ck_rwlock: Fix conflict.
...
ck_swlock will be a copy-safe single-writer multi-reader lock that
will meet our requirements.
11 years ago
Samy Al Bahra
e2913ab9c0
Revert "ck_rwlock: Migrate to 32-bit primitives and add a write_latch operation."
...
This reverts commit 210b724061
.
Conflicts:
include/ck_rwlock.h
11 years ago
Samy Al Bahra
6ccfb84d81
Revert "ck_rwlock: Use sub for unlatch operation."
...
This reverts commit b7c3c8a43d
.
11 years ago
Samy Al Bahra
ed476a617c
Revert "ck_rwlock: Clear reader bits on unlatch operation."
...
This reverts commit 7f945460bc
.
11 years ago
Samy Al Bahra
cdfac8213f
Revert "ck_rwlock: Re-observe latch bits if necessary."
...
This reverts commit fa28622386
.
11 years ago
Samy Al Bahra
88d323f40d
Revert "ck_rwlock: Acquire semantics for ordering on latch bits."
...
This reverts commit 2b567320de
.
11 years ago
Samy Al Bahra
9ebd19a124
Revert "ck_rwlock: Add ck_rwlock_read_latchlock operation."
...
This reverts commit bc7ebc62eb
.
11 years ago
Samy Al Bahra
cf097db790
Revert "ck_rwlock: Ignore latch bits on write lock operation."
...
This reverts commit 8173b937bf
.
11 years ago
Samy Al Bahra
e2bd885953
Revert "ck_rwlock: Re-organization of write-side operations and latch support for write_trylock."
...
This reverts commit ab22fda4e7
.
11 years ago
Samy Al Bahra
9aad0125af
Revert "ck_rwlock: Additional re-organization of write-side functions."
...
This reverts commit d9b86d2d89
.
11 years ago
Samy Al Bahra
d3a7adaf8c
Revert "ck_rwlock: Additional reorganization."
...
This reverts commit 56de32fffd
.
11 years ago
Samy Al Bahra
2a701163eb
ck_rwlock: Ditch ck_rwlock latch for ck_swlock.
11 years ago
Samy Al Bahra
56de32fffd
ck_rwlock: Additional reorganization.
11 years ago
Samy Al Bahra
d9b86d2d89
ck_rwlock: Additional re-organization of write-side functions.
11 years ago
Samy Al Bahra
ab22fda4e7
ck_rwlock: Re-organization of write-side operations and latch support for write_trylock.
11 years ago
Samy Al Bahra
8173b937bf
ck_rwlock: Ignore latch bits on write lock operation.
11 years ago
Samy Al Bahra
bc7ebc62eb
ck_rwlock: Add ck_rwlock_read_latchlock operation.
...
This avoids degradation on read_lock path for use-cases not
requiring latch semantics.
11 years ago
Samy Al Bahra
2b567320de
ck_rwlock: Acquire semantics for ordering on latch bits.
11 years ago
Samy Al Bahra
fa28622386
ck_rwlock: Re-observe latch bits if necessary.
11 years ago
Samy Al Bahra
7f945460bc
ck_rwlock: Clear reader bits on unlatch operation.
11 years ago
Samy Al Bahra
b7c3c8a43d
ck_rwlock: Use sub for unlatch operation.
11 years ago
Samy Al Bahra
210b724061
ck_rwlock: Migrate to 32-bit primitives and add a write_latch operation.
...
write_latch allows writers to prevent incoming read acquisitions from
succeeding while permitting write_lock operations to complete. This is
useful if multiple writers are cooperating in linearizing a non-blocking
data structure and allows for lock state to be copied by the write lock
holder safely.
In collaboration with Paul Khuong and Jaidev Sridhar.
11 years ago
Samy Al Bahra
c197b37df1
legal: Update Copyright statements.
11 years ago
Samy Al Bahra
0353cdcb23
ck_rwlock: Migrate to acquire / release and other barrier improvements.
11 years ago
Samy Al Bahra
b67e91c858
ck_rwlock: Fold CK_ELIDE_ADAPTIVE_PROTOTYPE into PROTOTYPE.
12 years ago
Samy Al Bahra
768b5b3597
ck_rwlock: Add adaptive elision and unit tests.
12 years ago
Samy Al Bahra
671f82d7a8
ck_rwlock: Migrate to ck_elide.h.
12 years ago
Samy Al Bahra
a03d58fff2
ck_rwlock: Use heavier-weight barrier on write path.
...
This is an example limitation of fence_X_Y variant. I am
considering extending this to include an acquire extension.
Use a memory fence to force total order in a manner that
will be clearer to other developers who read this.
This did not manifest as a problem on any target architectures
due to their handling of atomic operations (SPARC models it as
both a load and a store, while Power atomic_load ordering was
enforced through a full barrier).
12 years ago
Samy Al Bahra
a694e871ca
ck_rwlock: Relax write_trylock_rtm semantics.
...
trylock semantics are best effort to begin with, so
avoid fallback path all together.
12 years ago
Samy Al Bahra
3fbefc5042
ck_rwlock: Add read_trylock_rtm.
12 years ago
Samy Al Bahra
4d2ccfe497
ck_rwlock: Add basic RTM interface to rwlock.
...
It is possible this will be moved to a self-contained file.
For a majority of architectures, RTM is an unnecessary
implementation-specific optimization.
12 years ago
Samy Al Bahra
3f06a4e23a
ck_rwlock: Use ck_pr_fence_atomic.
12 years ago
Samy Al Bahra
8c53de1e70
ck_rwlock: Add documentation on visibility semantics.
12 years ago
Samy Al Bahra
1ea5769fd4
ck_rwlock: Improve code legibility.
12 years ago
Samy Al Bahra
038b3d816d
ck_rwlock: Forgot to add acquire on operation success.
12 years ago
Samy Al Bahra
33a9222923
legal: Update Copyright statements.
12 years ago
Samy Al Bahra
bf30d3439c
ck_rwlock: Remove unncessary load fences, switch to full semantics on read unlock.
...
rwlock may also be used in SPMC workloads.
12 years ago
Samy Al Bahra
e78bbe9ae6
ck_{rw,byte,br}lock: Serialize final loads with respect to read.
...
I will switch to a SPARC-style barrier interface.
12 years ago
Samy Al Bahra
45f310893c
ck_rwlock: Fix behavior for weakly-ordered systems.
...
As ck_pr semantics were still not molded, I was designing
under the assumption I would potentially go towards
acq/req interface. Since RMO will be the semantic norm for
the ck_pr model from now on, enforce stricter ordering
requirements on rwlock.
ck_rwlock_write_unlock function will now also serialize both
loads and stores.
12 years ago
Samy Al Bahra
314ce3ad81
ck_rwlock: Drop factor argument to trylock API.
...
Remove read-side recursion tests, it is an unsupported
feature to begin with.
13 years ago
Samy Al Bahra
512bbc050b
ck_rwlock: Add recursive trylock operations.
...
Unlike ck_rwlock, there is no spin factor associated with these.
13 years ago
Samy Al Bahra
606afe0f23
ck_rwlock: Add ck_rwlock_recursive facility.
...
Allows for write-side recurion. Added upon request by
other users. Regression test has been updated.
13 years ago
Samy Al Bahra
706fd07de7
legal: Update Copyright statements.
13 years ago
Samy Al Bahra
50f6f6ee02
ck_rwlock: Add ck_rwlock_write_downgrade.
...
This function allows the writer to downgrade to shared access
atomically.
13 years ago