more sleep yield testing

This commit is contained in:
jacob 2025-07-10 11:16:15 -05:00
parent 1dd5bf90d0
commit f1f54fe519
8 changed files with 735 additions and 218 deletions

View File

@ -485,6 +485,7 @@ void OnBuild(StringList cli_args)
"-Wno-c99-extensions -Wno-c++98-compat-pedantic -Wno-c++98-compat "
"-Wno-switch-enum -Wno-switch-default "
"-Wno-reserved-identifier -Wno-reserved-macro-identifier "
"-Wno-missing-designated-field-initializers "
"-Wno-unsafe-buffer-usage "
"-Wno-c11-extensions -Wno-gnu-anonymous-struct -Wno-nested-anon-types ");

View File

@ -400,7 +400,7 @@ INLINE f32 math_sqrt(f32 x)
return ix_sqrt_f32(x);
}
INLINE f32 math_sqrt64(f32 x)
INLINE f64 math_sqrt64(f64 x)
{
return ix_sqrt_f64(x);
}

View File

@ -7,10 +7,10 @@
#if PROFILING
#define PROFILING_SYSTEM_TRACE 1
#define PROFILING_SYSTEM_TRACE 0
#define PROFILING_CAPTURE_FRAME_IMAGE 0
#define PROFILING_LOCKS 0
#define PROFILING_D3D 1
#define PROFILING_D3D 0
#define PROFILING_FILE_WSTR L".tracy"
#define PROFILING_CMD_WSTR L"cmd /C start \"\" /wait tracy-capture.exe -o .tracy -a 127.0.0.1 && start \"\" tracy-profiler.exe .tracy"
//#define PROFILING_CMD_WSTR L"tracy-profiler.exe -a 127.0.0.1"

View File

@ -4,7 +4,8 @@
#include "memory.h"
#include "intrinsics.h"
#define DEFAULT_MUTEX_SPIN 4000
//#define DEFAULT_MUTEX_SPIN 4000
#define DEFAULT_MUTEX_SPIN 0
/* ========================== *
* Mutex

View File

@ -430,7 +430,11 @@ b32 sys_run_command(struct string cmd);
/* ========================== *
* Scheduler
* ========================== */
i64 sys_current_scheduler_period_ns(void);
/* ========================== *
* Wait

File diff suppressed because it is too large Load Diff

View File

@ -91,7 +91,6 @@ GLOBAL struct {
i32 console_log_color_indices[LOG_LEVEL_COUNT];
f32 console_logs_height;
b32 debug_console;
b32 profiler_launched;
/* Window -> user */
struct snc_mutex sys_events_mutex;

View File

@ -265,8 +265,9 @@ INLINE void sleep_precise(i64 sleep_time_ns)
{
__prof;
i64 tolerance = 200000;
i64 big_sleep = 500000;
i64 big_sleep = sys_current_scheduler_period_ns();
i64 tolerance = big_sleep * 0.5;
//i64 tolerance = 1000000000;
i64 now_ns = sys_time_ns();
i64 target_ns = now_ns + sleep_time_ns;