[REQ] Run function on all threads
lgs-baada opened this issue · 1 comments
lgs-baada commented
Describe the new feature
Run a function on all threads when creating (or changing) the thread pool.
Code example
BS::thread_pool pool([] { nice(1); });
Or:
BS::thread_pool pool(12, [] { nice(1); });
Or:
BS::thread_pool pool([] (auto id) {
const auto name = std::format("worker{}", id);
pthread_setname_np(pthread_self(), name.c_str());
});
Additional information
This feature can be used to change settings of the threads (priority, name, etc.).