Commit graph

24 commits

Author SHA1 Message Date
Nekotekina 9710473a2e atomic.hpp: use native semaphores on Windows
Windows: drop keyed events
Linux: keep using native futex
Implement unused POSIX semaphore path
Implement fallback semaphore with pure std (OSX, BSD, etc)
2019-09-24 05:01:00 +03:00
Nekotekina 95c939f014 atomic.hpp: fix pointer mask 2019-09-24 05:01:00 +03:00
Nekotekina 74471e8ea3 atomic.hpp: fixup for atomic waiting 2019-09-24 05:01:00 +03:00
Nekotekina 17d764409e Add init_mutex.hpp
Pseudo-mutex to protect initialization and finalization
2019-09-19 02:16:14 +03:00
Nekotekina 3092914527 typeindices.hpp: add typeindex() helper 2019-09-19 02:16:14 +03:00
Nekotekina c7bf6421f4 typeindices.hpp: rename typeinfo_v to typelist_v 2019-09-19 02:16:14 +03:00
Nekotekina be61499790 typeindices.hpp: fix constexpr constructor
Serious bug...
2019-09-19 02:16:14 +03:00
Nekotekina 8054735cab Fix manual_fixed_typemap::init result (g_fxo)
Return uncasted pointer to created type
2019-09-19 02:16:14 +03:00
Nekotekina e982871ab5 atomic.hpp: increase hashtable capacity
Double size and ignore 2 lowest bits (effectively x8)
2019-09-13 15:53:34 +03:00
Nekotekina 2fc8844315 atomic.hpp: add atomic wait mask support 2019-09-13 15:53:34 +03:00
Nekotekina 4504ac2d12 atomic.hpp: implement collision fallback properly
Should prevent devastating effect of collisions
2019-09-10 19:25:39 +03:00
Nekotekina 67f31c17d1 atomic.hpp: fix signal saturation logic
Make sure to notify_all at max signal count.
2019-09-10 19:25:39 +03:00
Nekotekina a808c2aaf6 atomic.hpp: optimize internal logic
Move waiter count to highest bits to prevent false futex wakeups.
Test pointer bits properly in notify_all to avoid false wakeups.
2019-09-10 19:25:39 +03:00
Nekotekina aa99faa85d atomic.hpp: add timeout support 2019-09-10 19:25:39 +03:00
Nekotekina 1668d6ee1b atomic.hpp: implement wait callback interface
Will be used to wake up threads uniformly.
2019-09-10 17:43:04 +03:00
Nekotekina 6811ec562c Use parentheses for new T() syntax
MSVC keeps being dumb...
2019-08-27 03:50:15 +03:00
Nekotekina 8517ccfdfa Add new typemap for always existing objects
Not to be confused with singletons or global variables.
2019-08-22 02:13:39 +03:00
Nekotekina 11a43e25d7 typeindices.hpp - start index from 0
Starting it from 1 makes it more error-prone to use.
2019-08-17 23:40:51 +03:00
Nekotekina 4df1c16099 Implement stx::typeinfo_v (util/typeindices.hpp)
Move and generalize logic from typemap.h
2019-08-14 21:04:25 +03:00
Nekotekina 4f22559ff0 Remove dumb overloads of atomic_op, fetch_op
And lf_queue::apply.
Fix inlining problem by passing F by value.
2019-08-14 20:28:34 +03:00
Nekotekina 5bd17a44c9 Add fallback implementation for waitable atomics
May improve perf on OSX/BSD
2019-08-02 18:37:23 +03:00
Nekotekina c6993d3f1c Change bits of waitable atomics
Reduce max waiter count to 2^14.
Refactor code to use waiter_mask and signal_mask constants.
2019-07-29 21:55:59 +03:00
Nekotekina e1db6cef6f Remove ignored bits in waitable atomics
It was not implemented correctly.
2019-07-29 21:55:59 +03:00
Nekotekina f63e89f9b4 Implement waitable atomics
Moved Atomic.h to util/atomic.hpp
List source files in CMakeLists.txt
2019-07-29 03:04:55 +03:00