-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
Milestone
Description
This std::async(),
spring/libraries/chain/include/eosio/chain/merkle.hpp
Lines 35 to 48 in 909603c
| auto async_calculate_merkle_pow2 = [&start, &size](auto fut) { | |
| size_t slice_size = size / fut.size(); | |
| for (size_t i=0; i<fut.size(); ++i) | |
| fut[i] = std::async(std::launch::async, calculate_merkle_pow2<It>, | |
| start + slice_size * i, start + slice_size * (i+1)); | |
| std::array<digest_type, fut.size()> res; | |
| for (size_t i=0; i<fut.size(); ++i) | |
| res[i] = fut[i].get(); | |
| return calculate_merkle_pow2(res.begin(), res.end()); | |
| }; |
leads to the full creation and destruction of at least 2 threads for every block. Would be nice to figure out how to use a thread pool here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done