boolbStartSchedularOnStartup{true};// spawns the scheduler thread during the runtime initialization process, otherwise delegate the spawn until the very last minute.
boolbEnableLegacyTicks{false};// turn this on to enable an async-app/singleton-threadpool to SysPump tick on thread worker-id: zero. Alternatively, use SetMainThreadForSysPumpScheduling once you have a thread pool and worker id.
AuUInt32dwLegacyMainThreadSystemTickMS{60};// nowadays this is used to dispatch AuConsole commands to a mainthread with AuAsync.
boolbEnableCpp20RecursiveCallstack{true};// enables/disables co_routine support in that the runtime can work with nested IWorkItem::BlockUntilComplete()'s and IThreadPool::[Run/Poll/RunOnce/etc]()'s.
boolbIsApplicationClientSoftwareOnJitteryMemorySystem{false};// enable me to enable padding from system out of memory conditions.
// the catch: usually this memory is reserved for exit callbacks, internal low memory conditions, error reporting, and the like.
//
// generally you should not exploit this without ** acknowledging this thread-local condition via AuDebug::[Add/Dec]MemoryCrunch. ** ( << tl;dr: recommended way of accessing this memory)
//
// setting this flag enables debug buffer memory to be used at any point during any threads execution - the moment mimalloc runs
// out of pre-reserved and system mappable memory. i wouldn't use this for anything except monolithic client/user-facing applications
// that are likely to run on low resource systems (low spec or heavy app), with untested/uncaught C++ allocations splattered everywhere.
// this could be VERY useful to end users who are running into `bIsMemoryErrorFatal` crashes.
AuUInt32uDebugMemoryReserveSize{3*1024*1024};/* nowdays: a single v8 isolate is low sub-tens MB of memory, executable file sizes are low mbs, image sizes are much larger. forget small low-footprint vms
boolbWin32VerifyTrustFailMissingAPI{true};// just to not be annoying in the future
};
structThreadingConfig
{
// WARN: these values are not final
boolbNoThreadNames{false};
boolbPlatformIsSMPProcessorOptimized{true};// Whether to attempt to using mm_pause or similar instruction before yielding into the kernel
AuUInt16uSpinLoopPowerA{128};// Nudgable spinloop power. This is our local userland niceness factor
// This is comparable to Win32's SetCriticalSectionSpinCount applied across every single AuThreadPrimitives try-lock and lock.
// Adjust this value to compensate for longer critical sections when context switching isn't preferrable.
AuUInt64bEnableAggressiveScheduling:1{false};
AuUInt64bEnableAgrSchedulingRatelimit:1{true};
AuUInt64bPreferNt51XpMutexesOver8:1{false};
AuUInt64bPreferNt51XpCondvarsOver8:1{false};
AuUInt64bPreferNtCondvarModernWinSpin:1{false};
AuUInt64bPreferNtCondvarOlderWinSpin:1{true};
AuUInt64bPreferNtSemaphoreSpinTryLock:1{true};
AuUInt64bPreferNtMutexSpinTryLock:1{true};
AuUInt64bPreferNtCondMutexSpinTryLock:1{false};
AuUInt64bPreferLinuxSemaphoreSpinTryLock:1{true};
AuUInt64bPreferLinuxMutexSpinTryLock:1{true};
AuUInt64bPreferLinuxCondMutexSpinTryLock:1{true};
#if 0
AuUInt64bPreferEmulatedWakeOnAddress:1{false};
#else
AuUInt64bPreferEmulatedWakeOnAddress:1{!AuBuild::kIsNtDerived/*everybody else requires us to hit the kernel. */};
#endif
AuUInt64bPreferWaitOnAddressAlwaysSpin:1{false};// ..., if emulated! if double-spinning under higher level locks, disable me.
AuUInt64bPreferWaitOnAddressAlwaysSpinNative:1{!AuBuild::kIsNtDerived};// ..., if not emulated! noting that most kernels and user-schedulers will spin for you
AuUInt64bWinXpThrough7BlazeOptimizerPower:12{300};// dont worry about it. we dont care about old portables. lets try to make older win32 targets tweak the scheduling in our favor a bit.
// On other POSIX platforms, its best to keep timers emulated in process.
// By default, you have to opt into a higher res in-process, if required by the platform.
// This does not bypass IO yielding or timeouts; we simply use our own semaphore and scheduler instead of the kernels.
// It only takes 8k ns to 60k ns depending on the platform to wake a thread, and we can hit AuAsync scheduler without too much error, we can just do this instead of relying on historically shitty IO primitives.
// Assiging this to true, on any platform, will bypass the kernels timer ticker.
boolbForceAltOSTimerPrimitives{false};
// High resolution timers will be emulated in process, if this is assigned false, and we're on a platform with good IO timers
// For niche POSIX targets and Windows, this value will not be respected.
// For Linux, this value can be used to experience/test/benchmark Win32-like in-process scheduling.