impl shared thread pool mode

This commit is contained in:
Nikita Smith
2025-01-20 21:41:24 -08:00
parent e1e7fb745e
commit d3fbc858b8
5 changed files with 118 additions and 68 deletions
+7 -2
View File
@@ -3189,8 +3189,13 @@ lnk_run(int argc, char **argv)
LNK_Config *config = lnk_build_config(scratch.arena, argc, argv);
TP_Context *tp = tp_alloc(scratch.arena, config->worker_count);
TP_Arena *tp_arena = tp_arena_alloc(tp);
TP_Context *tp;
if (config->shared_thread_pool == LNK_SwitchState_Yes) {
tp = tp_alloc_shared(scratch.arena, config->worker_count, config->shared_thread_pool_mutex_name);
} else {
tp = tp_alloc(scratch.arena, config->worker_count);
}
TP_Arena *tp_arena = tp_arena_alloc(tp);
#if PROFILE_TELEMETRY
{