Samy Al Bahra
d6ba2a6273
whitespace: Sweeping whitespace changes.
...
Removing trailing whitespaces and newlines.
10 years ago
Samy Al Bahra
cefd6bc9ec
ck_ring: Remove stale comment from pre-memcpy implementation.
11 years ago
Samy Al Bahra
396ceb16bb
ck_ring: Fix typo in type-specialized ck_ring_dequeue_tryspmc.
...
Thanks to Paul Khuong <pkhuong@appnexus> for patch.
11 years ago
Samy Al Bahra
c197b37df1
legal: Update Copyright statements.
11 years ago
Samy Al Bahra
057f719796
ck_ring: Add type-specialized ring.
11 years ago
Samy Al Bahra
90c9950356
ck_ring: Type-agnostic backend implementation.
...
This will serve to drive both pointer-based and type-specialized ring
implementations. Some full fences have also been removed as they are
unnecessary with the introduction of X_Y fence interface.
11 years ago
Samy Al Bahra
b6a1914085
ck_ring: Prefer treatment of ck_ring_buffer_t as an opaque type.
11 years ago
Samy Al Bahra
b6f085a62e
ck_ring: Minor style change.
11 years ago
Olivier Houchard
3edb523da5
ck_ring: Move the ring buffer outside of the ck_ring_t
...
Remove the ring buffer from the struct ck_ring, it is now required to
explicitely pass the ring buffer for enqueue/dequeue. That can be useful for
systems with multiple address spaces.
11 years ago
Samy Al Bahra
5d8a273dbe
whitespace: Bulk whitespace changes.
11 years ago
Samy Al Bahra
1201e09577
ck_ring: Remove stale comment.
12 years ago
Samy Al Bahra
878b8e6321
ck_ring: Correct CK_RING_SPMC_ENQUEUE_SIZE typo.
12 years ago
Samy Al Bahra
67381af3c5
ck_ring: Expose *_size variants to type-specialized ck_ring.
...
Added:
- CK_RING_ENQUEUE_SPSC_SIZE
- CK_RING_ENQUEUE_SPMC_SIZE
12 years ago
Samy Al Bahra
45f648bd33
ck_ring: Add *_size_* ck_ring enqueue operations.
...
These variants of ck_ring_enqueue_* return the snapshot of queue
length with respect to the linearization point. This can be used to
extract ring size without incurring additional cacheline invalidation
overhead from the writer.
12 years ago
Samy Al Bahra
0598307186
whitespace: Various style changes.
12 years ago
Samy Al Bahra
33a9222923
legal: Update Copyright statements.
12 years ago
Samy Al Bahra
c4149c72b4
ck_ring: Use regular assignment in type specialized ck_ring initialization.
12 years ago
Samy Al Bahra
89cb712ffa
ck_ring: Memoize mask across all operations.
12 years ago
Samy Al Bahra
8519aaf771
ck_ring: Memoize mask for SPMC operations.
12 years ago
Samy Al Bahra
b54ae5c4ac
ck_ring: Add a work-around for compiler bug(s) in ck_ring_dequeue_spmc.
...
Both LLVM-backed compilers and GCC incorrectly treat
a barrier-sandwiched load as a loop invariant in dequeue_spmc.
Forcing volatile atomic load semantics generates the right
thing.
Thanks to Devon O'Dell and Abel Mathew for help in catching
this issue.
12 years ago
Samy Al Bahra
849f938973
ck_ring: Add parameterized version of ck_ring_trydequeue.
12 years ago
Samy Al Bahra
7a99585f9e
ck_ring: No need for volatile load on dequeue_spmc.
12 years ago
Samy Al Bahra
01dc51db65
ck_ring: Add trydequeue variant.
12 years ago
Samy Al Bahra
055a7fd5db
ck_ring: Add wrapper functions for parameterized SPMC ring.
12 years ago
Samy Al Bahra
68b33e56d8
ck_ring: Add parameterized version of SPMC ring.
12 years ago
Samy Al Bahra
7f35cbee1b
ck_ring: Use SPSC enqueue as SPMC enqueue.
12 years ago
Samy Al Bahra
5d1d850f44
ck_ring: Adopt semantics identical to spmc counter semantics.
12 years ago
Samy Al Bahra
77a3bd3126
ck_ring: Move overflow check to producer side.
...
unsigned int-sized counters will be used on producer
and consumer side. This is necessary to allow a ring
to be used on multiple workloads.
12 years ago
Samy Al Bahra
d595bafea7
ck_ring: Serialize producer snapshot with respect to consumer.
12 years ago
Samy Al Bahra
d705e02b76
ck_ring: Replace MPMC variant with SPMC variant for starters.
...
Immediate use-case is SPMC. Next is MPSC, then I will generalize
to MPMC (unfortunately, I don't have an algorithm that avoids CAS2
yet for MPMC).
12 years ago
Samy Al Bahra
bb48f602ff
ck_ring: Add note regarding correctness so people don't both verifying it.
...
Original version is susceptible to several problems, it is whack.
12 years ago
Samy Al Bahra
68e6752e53
ck_ring: Due to popular request, add MPMC variants of enqueue/dequeue.
...
Fencing semantics are heavier-weight than they need to be.
12 years ago
Samy Al Bahra
a06f28b77c
ck_ring: Remove useless comment.
12 years ago
Samy Al Bahra
955047a7d1
ck_{ring,fifo}: Add store fences while we lack load_store fences.
12 years ago
Samy Al Bahra
b1b19c1f74
ck_ring: Memory fence is overly pedantic for parameterized enqueue.
12 years ago
Samy Al Bahra
80c56d115b
ck_ring: Do not use volatile load for parametric ck_ring_size.
12 years ago
Samy Al Bahra
ad5e143bd5
ck_ring: Various improvements to readability.
...
No regressions in unit tests, so I'm dropping volatile
semantics for unnecessary volatile load/store on producer/consumer
side.
12 years ago
Samy Al Bahra
94c26494a6
ck_ring: Size is no longer necessary.
...
Patch submitted by Andrew Schorr.
12 years ago
Samy Al Bahra
3cf265cba0
all: Strip trailing whitespaces.
13 years ago
Samy Al Bahra
42b32c6e6a
ck_ring: Apply ck_ring_size logic to ck_ring_enqueue functions.
...
This bug fix was contributed by Matt Johnson <johnso87@...>.
13 years ago
Samy Al Bahra
706fd07de7
legal: Update Copyright statements.
13 years ago
Samy Al Bahra
5889498c16
ck_ring: Add modulo logic to ck_ring_size and CK_RING_SIZE.
14 years ago
Samy Al Bahra
88ee328b78
ck_ring: Add CK_RING_SIZE/CAPACITY and ck_ring_size/capacity.
...
ck_ring_size will return the current size of the ring while ck_ring_capacity
will return the capacity of the specified ring.
14 years ago
Samy Al Bahra
7c8ab13343
Some fixes for strict aliasing. Silence some warnings from clang.
14 years ago
Samy Al Bahra
66ebe1a874
Drop usage of CK_CC_PACKED, prefer natural alignment.
...
CK_CC_PACKED will drop structures to one-byte alignment in certain
cases. Obviously, this will mean bad performance on most architectures.
Thanks to Matt Johnson from https://rigel.crhc.illinois.edu/ for
reporting this problem.
14 years ago
Samy Al Bahra
cbd30b2206
Initial import.
14 years ago