Skip to content

Commit

Permalink
impl shared thread pool mode
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaSmith057 committed Jan 21, 2025
1 parent e1e7fb7 commit d3fbc85
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 69 deletions.
9 changes: 7 additions & 2 deletions src/linker/lnk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Loading

0 comments on commit d3fbc85

Please sign in to comment.