Skip to content

Commit

Permalink
feat: Make dcurl set the threadpool size of libtuv
Browse files Browse the repository at this point in the history
In the initialization phase of dcurl,
the threadpool size is preset to the (maximum processor - 1)
with the new libtuv API uv_set_threadpool_size().
Then the threadpool would be initialized in the first call of dcurl_entry()
with the preset size.

Close #149.
  • Loading branch information
marktwtn committed May 27, 2019
1 parent 4f0c94d commit c3dce38
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deps/libtuv
Submodule libtuv updated 2 files
+2 −0 include/uv.h
+8 −0 src/threadpool.c
1 change: 1 addition & 0 deletions src/pow_avx.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ static bool PoWAVX_Context_Initialize(ImplContext *impl_ctx)
impl_ctx->bitmap = impl_ctx->bitmap << 1 | 0x1;
uv_loop_init(&ctx[i].loop);
}
uv_set_threadpool_size(nproc);
impl_ctx->context = ctx;
uv_mutex_init(&impl_ctx->lock);
return true;
Expand Down
1 change: 1 addition & 0 deletions src/pow_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ static bool PoWC_Context_Initialize(ImplContext *impl_ctx)
impl_ctx->bitmap = impl_ctx->bitmap << 1 | 0x1;
uv_loop_init(&ctx[i].loop);
}
uv_set_threadpool_size(nproc);
impl_ctx->context = ctx;
uv_mutex_init(&impl_ctx->lock);
return true;
Expand Down
1 change: 1 addition & 0 deletions src/pow_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ static bool PoWSSE_Context_Initialize(ImplContext *impl_ctx)
impl_ctx->bitmap = impl_ctx->bitmap << 1 | 0x1;
uv_loop_init(&ctx[i].loop);
}
uv_set_threadpool_size(nproc);
impl_ctx->context = ctx;
uv_mutex_init(&impl_ctx->lock);
return true;
Expand Down

0 comments on commit c3dce38

Please sign in to comment.