Software Open Access
Barak Shoshany
thread_pool_test.cpp
has been added to the package. It will perform automated tests of all aspects of the package, and benchmark some multithreaded matrix operations. Please run it on your system and submit a bug report if any of the tests fail. In addition, the code is thoroughly documented, and is meant to serve as an extensive example of how to properly use the package.README.md
. See this pull request.THREAD_POOL_VERSION
, which returns the version number and release date of the thread pool library as a string.parallelize_loop()
has undergone some major changes (and is now incompatible with v1.x):[first, last)
. For example, for an array with n
indices, instead of parallelize_loop(0, n - 1, ...)
you should now write parallelize_loop(0, n, ...)
.loop
function is now only called once per block, instead of once per index, as was the case before. This should provide a performance boost due to significantly reducing the number of function calls, and it also allows you to conserve resources by using them only once per block instead of once per index (an example can be found in the random_matrix_generator
class in thread_pool_test.cpp
). It also means that loop
now takes two arguments: the first index in the block and the index after the last index in the block. Thus, loop(start, end)
should typically involve a loop of the form for (T i = start; i < end; i++)
.parallelize_loop(0, i, ...)
did not work if i
was not an int
, because 0
was interpreted as int
, and the two arguments had to be of the same type. Therefore, one had to use casting, e.g. parallelize_loop((size_t)0, i)
, to make it work. Now this is no longer necessary; the common type is inferred automatically using std::common_type_t
.Name | Size | |
---|---|---|
bshoshany/thread-pool-v2.0.0.zip
md5:5db633634ca3c75fdaa572bfecc11b61 |
33.6 kB | Download |
All versions | This version | |
---|---|---|
Views | 741 | 262 |
Downloads | 23 | 3 |
Data volume | 621.5 kB | 100.8 kB |
Unique views | 683 | 248 |
Unique downloads | 13 | 3 |