Less undefined behaviour is always good. In practice, compilers seem
to handle either form correctly, but some static analysis tools have
trouble with (size_t)&((T *)0)->M).
These were always no-op on TSO. For non-TSO, we assume
data dependent ordering. Next to data does not require ordering
but data to next does. However, a re-ordering here is benign
in that a stale load will observe an initialized NULL value.
We would rather not pay the load cost for the common case.
Write-side fences are unchanged.
From discussions with markj@freebsd.org.
When defining the LOCK macro, make sure we calculate the index for the
local_lock right, core % (CORES / 2) sounds way better than (core % CORES) / 2,
especially when CORES is an odd number.
This should fix github issue #153.
1. For ck_pr_cas_foo_value, let the inline assembly save the observed
value in a register, and store to the output reference in C.
This lets the C optimiser eliminate the memory access once the
CAS function is inlined.
2. Specify the result of the CAS as a condition code in EFLAGS instead
of executing SETcc in inline assembly, when possible. GCC gained
this functionality in GCC 6; CAS loops can now directly branch on
the condition code, without SETcc / TEST.
TESTED=existing regression tests.
glibc-2.30 added a wrapper to gettid (https://lwn.net/Articles/795127/).
gettid will clash with the glibc-provided symbol. Remove the
macro and instead move to a dedicated namespace.
We go this route to avoid introducing unnecessary complexity to
build.
Fixes#147
Previously, we would simply fail if the architecture was not
a first-class citizen. However, we have always allowed a built-in
fallback in code.
Instead, allow for people to direcly use the builtin fallback without
having to provide their own profiles and emit a loud warning.
This new interface allows for slot reservation to avoid additional
copy-overhead from consumer. The primary use-case is for the type-specialized
variant of ck_ring. The initial patch-set does not migrate enqueue and
dequeue to be implemented in terms of reserve and commit but will be a future
commit.
There was a silly typo and circular dependency introduced in the migration.
Thanks to Sarah Edkins <sedkins@backtrace.io> for letting me borrow her laptop
to investigate.
These tests check for sane behavior in the presence of new
maps being created for the hash set. They require the presence
of SMR.
For the life time of the growth_spmc tests, disable deallocation.