Closed joserochh closed 1 year ago
Unit-test on Windows 10 IceLake system fails on the following tests:
[ RUN ] ThreadPool.setup_num_threads_env_var
C:\Users\monol\Documents\WORKS\intel_hexl\hexl\test\test-thread-pool.cpp(112): error: Expected equality of these values:
value
Which is: 1
max_or_default
Which is: 8
[ FAILED ] ThreadPool.setup_num_threads_env_var (0 ms)
[ RUN ] ThreadPool.setup_ntt_calls_env_var
C:\Users\monol\Documents\WORKS\intel_hexl\hexl\test\test-thread-pool.cpp(172): error: Expected equality of these values:
value
Which is: 0
HEXL_DEFAULT_NTT_PARALLEL_DEPTH
Which is: 1
[ FAILED ] ThreadPool.setup_ntt_calls_env_var (0 ms)
[ FAILED ] 2 tests, listed below:
[ FAILED ] ThreadPool.setup_num_threads_env_var
[ FAILED ] ThreadPool.setup_ntt_calls_env_var
So far the thread pool is meant to be used from one single main thread. Protection was added in case multiple threads try to use the thread pool in parallel. If the thread pool is busy while a parallel thread try to add new tasks then those tasks will be immediately run on the same thread sequentially. In other words, any other thread trying to use a busy thread pool wont be blocked waiting for resources. However, parallel thread pool edition (Adding/Removing threads) is blocked until any other thread has finished updating or using the thread pool.