You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For n requested workers, the current implementation spawns n additional threads executing work_loop() while the main() -thread does nothing but emplacing the tasks and then waiting for the other (worker-)threads to finish executing all tasks.
The proposal is to
enable the main thread to change its role from "task-creator" to "worker" by storing some task_creator_continuation in the redgrapes::Context , which is initalized whenever the current task-creator thread decides to switch into worker-mode.
let other worker threads take the task_creator_continuation as a last resort to obtain new tasks when all queues are empty.
create n-1 additional threads when n workers are requested.
Potential benefits:
might decrease latency because after task emplacement, we do not need to wake up another, potentially sleeping thread which will then further process this task on another core. Instead we can directly proceed on the same thread and core from where the task originated.
Questions:
strategy for when the task-creator should switch into worker mode. As soon as possible, i.e. whenever it created a task that is immediately ready ?
Implementation Details:
create a "Root Task" , which is referenced from the redGrapes::Context instead of referencing the "Root task-space" and a separate continuation.
conceptually the functor for the root-task is the main() function., but its initialized implicitly and not by emplace_task.
for sub-graphs, the task-creator-continuation corresponds to the continuation of the parent task.
The text was updated successfully, but these errors were encountered:
For
n
requested workers, the current implementation spawnsn
additional threads executingwork_loop()
while themain()
-thread does nothing but emplacing the tasks and then waiting for the other (worker-)threads to finish executing all tasks.The proposal is to
task_creator_continuation
in theredgrapes::Context
, which is initalized whenever the current task-creator thread decides to switch into worker-mode.task_creator_continuation
as a last resort to obtain new tasks when all queues are empty.n-1
additional threads whenn
workers are requested.Potential benefits:
Questions:
Implementation Details:
redGrapes::Context
instead of referencing the "Root task-space" and a separate continuation.task-creator-continuation
corresponds to the continuation of the parent task.The text was updated successfully, but these errors were encountered: