AuroraRuntime/Include/Aurora/Threading
2024-06-30 05:40:13 +01:00
..
Primitives [*] d589ce3549 missed header update 2024-05-11 18:51:16 +01:00
Threads [*] Refactor IAuroraThread 2024-05-27 13:28:57 +01:00
Waitables [+] Au[Futex]Countdown 2024-06-30 05:40:13 +01:00
InitOnce.hpp [*] Minor include header improvements 2023-09-22 00:46:51 +01:00
IWaitable.hpp [*] Ehhh. I never liked how I implemented the fallback for MS absolute waits. 2023-09-12 17:10:51 +01:00
LockGuard.hpp [*] MSVC isn't always inlining lock guards 2023-09-19 02:49:48 +01:00
LockGuardTry.hpp [*] A patch to fix some of the regressions introduced in the first step in overhauling AuAsync 2023-06-07 20:35:31 +01:00
README SleepNote.txt [+] NS readmes 2022-06-12 18:28:51 +01:00
README.md [*] Updated/added FutexBarrier comments and updated AuThreadings README 2024-05-27 14:35:10 +01:00
Sleep.hpp Initial Commit 2021-06-27 22:25:29 +01:00
SpinTime.hpp [*] Cleanup/formatting of SMT yields 2023-09-06 17:01:01 +01:00
Threading.hpp [+] AuInitOnce 2023-09-17 13:26:37 +01:00
WaitFor.hpp [*] Updated AuTheading::WaitFor prototype 2024-05-27 15:04:21 +01:00
WakeOnAddress.hpp [*] Update: WakeOnAddress.hpp comments 2024-06-30 05:13:55 +01:00

AuThreading

Features

  • Thread synchronization primitives: condition ex, condition mutex, condition variable, critical section, event, mutex, rwlock, semaphore, and spinlock
  • All primitives include a trylock and a nanosecond-resolution timed lock methods
  • All lock-like primitives can be used with a AuFlexibleConditionVariable (noting AuConditionVariable binds to a single AuCondMutex)
  • WakeOnAddress support on every operating system regardless of kernel support
  • WakeOnAddress with various wake operations (eNotEqual, eEqual, eLessThanCompare, eGreaterThanCompare, eLessThanOrEqualsCompare, eGreaterThanOrEqualsCompare) of any size under 32 bytes
  • Reference futex primitives: AuInitOnce, AuInitOnceSmall, AuFutexBarrier, AuFutexCond, AuFutexMutex, AuFutexSemaphore, FutexWaitable*NoVTbl**Movable*Smallest (AuFutexMutexSmallest)
  • No primitive will ever waste time syscalling or otherwise waking if not required
  • Single core (thread check), Intel SMT (rdtsc), AARCH64 (rdtsc emu via CNTVCT_EL0), Intel Alderlake (umonitor/tpause), and AMD 2016+ (monitorx) optimized/aware spinning optimizations with in-process and CPU heuristics
  • ...known good performance and low kernel stated CPU usage% on Windows 7, Windows 11, and Linux spanning a diverse range of processors.
  • Timeline semaphores / completion barriers are supported via AuFutexSemaphore::LockUntilAtleastAbsNS/AcquireUntilAtleastAbsNS
  • RWLock supports read-to-write upgrades when the decision to esclate is made based upon a shared resource, plus CheckSelfThreadIsWriter check
  • RWLocks are read criticial section based and all writer threads are allowed to enter read critical sections. In addition, AuRWRenterableLock allows for write reentrancy.
  • Enchanced Win32 support with increased yield resolution and optimization around internal XP, internal Win8, and UWP APIs
  • SleepNs function supporting higher resolution sleep available than in most APIs (^1)
  • Thread Object per native OS thread
  • Thread spawning with TLS handles and shutdown routines ~~dispatched under pseudo fibers. TODO: reimpl thread 'features' and NT-like APCs ~~
  • Update thread affinity, throttle, name, and related attributes
  • Lock Util: AU_LOCK_GUARD(pointer/reference/shared ptr)
  • Lock Util: AU_TRY_LOCK_GUARD[...](pointer/reference/shared ptr)

^1: README SleepNote.txt