Update duration of erase operations to trigger successful erasures when only 2 threads are available

This commit is contained in:
Christian Mazakas
2023-05-22 11:37:07 -07:00
parent a9203ed93c
commit 3ad164267a

View File

@ -147,7 +147,7 @@ namespace {
enable_exceptions(); enable_exceptions();
thread_runner( thread_runner(
values, [&num_erased, &x, threshold](boost::span<T> /* s */) { values, [&num_erased, &x, threshold](boost::span<T> /* s */) {
for (std::size_t i = 0; i < 128; ++i) { for (std::size_t i = 0; i < 256; ++i) {
try { try {
auto count = x.erase_if([threshold](value_type& v) { auto count = x.erase_if([threshold](value_type& v) {
static std::atomic<std::uint32_t> c{0}; static std::atomic<std::uint32_t> c{0};
@ -211,7 +211,7 @@ namespace {
enable_exceptions(); enable_exceptions();
thread_runner( thread_runner(
values, [&num_erased, &x, threshold](boost::span<T> /* s */) { values, [&num_erased, &x, threshold](boost::span<T> /* s */) {
for (std::size_t i = 0; i < 128; ++i) { for (std::size_t i = 0; i < 256; ++i) {
try { try {
auto count = auto count =
boost::unordered::erase_if(x, [threshold](value_type& v) { boost::unordered::erase_if(x, [threshold](value_type& v) {