Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Lima2 Lima2
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 95
    • Issues 95
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LimaGroupLimaGroup
  • Lima2Lima2
  • Issues
  • #110
Closed
Open
Issue created Feb 10, 2022 by Samuel Debionne@debionneOwner

Add is_finished to TBB Processing Pipelines

There is currently no way to reliably tell that a processing is finished (beside checking the available counters). With TBB, the only way is to call g.wait_for_all() which is a blocking call. Since we don't want to block the main thread, we can add a task to run the flow graph in the background.

void activate() {
  task_arena a;
  a.enqueue([background_task([this]() {
    // Construct graph (from preconstructed Body)
    graph g;
    function_node< int, int > f( g, 1, []( int i ) -> int {
      return spin_for(i);
    });

    //Activate source
    src.activate();
    
    g.wait_for_all();

    // Set captured is_finished
    this->is_finished = true;
  });
}

...

std::atomic_bool is_finished = false;
Assignee
Assign to
Time tracking