From de1ab890c4b193fd213a59682f33a5895063bb08 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sat, 12 Dec 2020 12:23:44 -0500 Subject: [PATCH] feat: admissions control headspace for overhead --- runtime/include/admissions_control.h | 4 +++- runtime/src/admissions_control.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/include/admissions_control.h b/runtime/include/admissions_control.h index 8e03440..d88c258 100644 --- a/runtime/include/admissions_control.h +++ b/runtime/include/admissions_control.h @@ -22,13 +22,15 @@ */ extern _Atomic uint64_t admissions_control_admitted; extern uint64_t admissions_control_capacity; +extern const double admissions_control_overhead; static inline void admissions_control_initialize() { #ifdef ADMISSIONS_CONTROL 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 } diff --git a/runtime/src/admissions_control.c b/runtime/src/admissions_control.c index d5aba8b..275bee3 100644 --- a/runtime/src/admissions_control.c +++ b/runtime/src/admissions_control.c @@ -2,3 +2,5 @@ _Atomic uint64_t admissions_control_admitted; uint64_t admissions_control_capacity; + +const double admissions_control_overhead = 0.2;