more sleep yield testing
This commit is contained in:
parent
1dd5bf90d0
commit
f1f54fe519
1
build.c
1
build.c
@ -485,6 +485,7 @@ void OnBuild(StringList cli_args)
|
|||||||
"-Wno-c99-extensions -Wno-c++98-compat-pedantic -Wno-c++98-compat "
|
"-Wno-c99-extensions -Wno-c++98-compat-pedantic -Wno-c++98-compat "
|
||||||
"-Wno-switch-enum -Wno-switch-default "
|
"-Wno-switch-enum -Wno-switch-default "
|
||||||
"-Wno-reserved-identifier -Wno-reserved-macro-identifier "
|
"-Wno-reserved-identifier -Wno-reserved-macro-identifier "
|
||||||
|
"-Wno-missing-designated-field-initializers "
|
||||||
"-Wno-unsafe-buffer-usage "
|
"-Wno-unsafe-buffer-usage "
|
||||||
"-Wno-c11-extensions -Wno-gnu-anonymous-struct -Wno-nested-anon-types ");
|
"-Wno-c11-extensions -Wno-gnu-anonymous-struct -Wno-nested-anon-types ");
|
||||||
|
|
||||||
|
|||||||
@ -400,7 +400,7 @@ INLINE f32 math_sqrt(f32 x)
|
|||||||
return ix_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);
|
return ix_sqrt_f64(x);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
#if PROFILING
|
#if PROFILING
|
||||||
|
|
||||||
#define PROFILING_SYSTEM_TRACE 1
|
#define PROFILING_SYSTEM_TRACE 0
|
||||||
#define PROFILING_CAPTURE_FRAME_IMAGE 0
|
#define PROFILING_CAPTURE_FRAME_IMAGE 0
|
||||||
#define PROFILING_LOCKS 0
|
#define PROFILING_LOCKS 0
|
||||||
#define PROFILING_D3D 1
|
#define PROFILING_D3D 0
|
||||||
#define PROFILING_FILE_WSTR L".tracy"
|
#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"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"
|
//#define PROFILING_CMD_WSTR L"tracy-profiler.exe -a 127.0.0.1"
|
||||||
|
|||||||
@ -4,7 +4,8 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "intrinsics.h"
|
#include "intrinsics.h"
|
||||||
|
|
||||||
#define DEFAULT_MUTEX_SPIN 4000
|
//#define DEFAULT_MUTEX_SPIN 4000
|
||||||
|
#define DEFAULT_MUTEX_SPIN 0
|
||||||
|
|
||||||
/* ========================== *
|
/* ========================== *
|
||||||
* Mutex
|
* Mutex
|
||||||
|
|||||||
@ -430,7 +430,11 @@ b32 sys_run_command(struct string cmd);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ========================== *
|
||||||
|
* Scheduler
|
||||||
|
* ========================== */
|
||||||
|
|
||||||
|
i64 sys_current_scheduler_period_ns(void);
|
||||||
|
|
||||||
/* ========================== *
|
/* ========================== *
|
||||||
* Wait
|
* Wait
|
||||||
|
|||||||
933
src/sys_win32.c
933
src/sys_win32.c
File diff suppressed because it is too large
Load Diff
@ -91,7 +91,6 @@ GLOBAL struct {
|
|||||||
i32 console_log_color_indices[LOG_LEVEL_COUNT];
|
i32 console_log_color_indices[LOG_LEVEL_COUNT];
|
||||||
f32 console_logs_height;
|
f32 console_logs_height;
|
||||||
b32 debug_console;
|
b32 debug_console;
|
||||||
b32 profiler_launched;
|
|
||||||
|
|
||||||
/* Window -> user */
|
/* Window -> user */
|
||||||
struct snc_mutex sys_events_mutex;
|
struct snc_mutex sys_events_mutex;
|
||||||
|
|||||||
@ -265,8 +265,9 @@ INLINE void sleep_precise(i64 sleep_time_ns)
|
|||||||
{
|
{
|
||||||
__prof;
|
__prof;
|
||||||
|
|
||||||
i64 tolerance = 200000;
|
i64 big_sleep = sys_current_scheduler_period_ns();
|
||||||
i64 big_sleep = 500000;
|
i64 tolerance = big_sleep * 0.5;
|
||||||
|
//i64 tolerance = 1000000000;
|
||||||
|
|
||||||
i64 now_ns = sys_time_ns();
|
i64 now_ns = sys_time_ns();
|
||||||
i64 target_ns = now_ns + sleep_time_ns;
|
i64 target_ns = now_ns + sleep_time_ns;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user