-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ] cpuaff integration #113
Comments
Thanks for the feature request! One of the guiding design principles of this package is that it only uses the C++17 standard library, and does not rely on any 3rd-party and/or platform-dependent features. Unfortunately, integration with the 3rd-party package cpuaff will go against this principle, and therefore will not be implemented. However, you are welcome to start your own fork with cpuaff integration. |
there is no need to rely on any 3rd-party and/or platform-dependent features, /**
* @brief A worker function to be assigned to each thread in the pool. Waits until it is notified by push_task() that a task is available, and then retrieves the task from the queue and executes it. Once the task finishes, the worker notifies wait_for_tasks() in case it is waiting.
*/
void worker()
{
callback_to_config_the_thread()......
while (running)
{
std::function<void()> task;
std::unique_lock<std::mutex> tasks_lock(tasks_mutex);
task_available_cv.wait(tasks_lock, [&] { return !tasks.empty() || !running; });
if (running && !paused)
{
task = std::move(tasks.front());
tasks.pop();
tasks_lock.unlock();
task();
--tasks_total;
if (waiting)
task_done_cv.notify_one();
}
}
} |
What you're asking for seems to be similar to #105, which is planned to be implemented in the next release. |
cpuaff integration
the lib make all the threads private,
Is it possible to give the user the opportunity to make some modify to the threads ?
i want to make Multiple Thread Pools,
as if one pool bind to core 1,2,
and another pool bind to core 3,4,
so that i can push task to the binded core
Code example
Additional information
http://dcdillon.github.io/cpuaff/
#37
The text was updated successfully, but these errors were encountered: