-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Pseudo code:
px_sched::Sync sync;
for(int i = 0; i < 100; ++i) {
scheduler.runTask([&](){
// Heavy task
}, &sync);
}
scheduler.waitFor(sync);
Here the calling thread that creates the task will suspend waiting for the tasks to be finished before carrying on. This requires the pool of threads to be bigger than the actual core count to allow some threads wait for others and still have enough threads to keep using all cpus. One possible solution could be for the thread that waits on a sync object to start doing tasks from the list of tasks related to that sync object.
The idea is that if the thread needs to wait for a task to be finished it can go on and start working on that lists of tasks itself instead of waiting.
rokups
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request