Closed marktwtn closed 5 years ago
I found out that it is hard to get the physical CPU number and hyperthreading data without parsing CPU information by the programmer.
get_nprocs_conf()
only gives us the logical CPU number, and the related function sysconf()
can not give us the physical CPU number, either.
It would be a lot of easier if we just modify dcurl
to do 1 PoW at the same time.
However, I would like to try the harder way to fit the original dcurl
design.
The
dcurl
before and after integrating the thread pool uses the (maximum logical CPU - 1) as the number of threads for a single PoW. However,dcurl
also allows calculating 2 PoW at the same time, which is the number of threads per core. And the number oflogical CPU
is equal to the number ofphysical CPU * threads per core
.Before integrating the thread pool,
dcurl
may create the threads as many as the twice number of the logical CPU. After integrating the thread pool,dcurl
set the pool size as (maximum logical CPU - 1). And it causes the PoW to wait for the threads returning from the previous PoW.Goal: