feat: admissions control headspace for overhead

main
Sean McBride 4 years ago
parent 4ee95349e6
commit de1ab890c4

@ -22,13 +22,15 @@
*/ */
extern _Atomic uint64_t admissions_control_admitted; extern _Atomic uint64_t admissions_control_admitted;
extern uint64_t admissions_control_capacity; extern uint64_t admissions_control_capacity;
extern const double admissions_control_overhead;
static inline void static inline void
admissions_control_initialize() admissions_control_initialize()
{ {
#ifdef ADMISSIONS_CONTROL #ifdef ADMISSIONS_CONTROL
atomic_init(&admissions_control_admitted, 0); atomic_init(&admissions_control_admitted, 0);
admissions_control_capacity = runtime_worker_threads_count * ADMISSIONS_CONTROL_GRANULARITY; admissions_control_capacity = runtime_worker_threads_count * ADMISSIONS_CONTROL_GRANULARITY
* ((double)1.0 - admissions_control_overhead);
#endif #endif
} }

@ -2,3 +2,5 @@
_Atomic uint64_t admissions_control_admitted; _Atomic uint64_t admissions_control_admitted;
uint64_t admissions_control_capacity; uint64_t admissions_control_capacity;
const double admissions_control_overhead = 0.2;

Loading…
Cancel
Save