Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7413099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:38:40+00:00 2026-05-29T06:38:40+00:00

I want to get a thread-pool behavior using TBB. But whenever I read documents

  • 0

I want to get a thread-pool behavior using TBB. But whenever I read documents about TBB they always talk about parallel-for, parallel-dowhile etc. In contrast what I need is a main thread to assign tasks to a thread pool so those tasks will be executed ‘on their own’ – execute tasks asynchronously. Tasks here can be event handling for a GUI.

Is the TBB task scheduler appropriate for such behavior? The impression I got from task scheduler is that it’s only beneficial if I have tasks that can be broken down and executed in parallel to each other.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:38:40+00:00Added an answer on May 29, 2026 at 6:38 am

    Starting from version 3.0, TBB has support for asynchronous execution of tasks. For that, a special work offering method tbb::task::enqueue() was added. Unlike tbb::task::spawn(), this method guarantees that the enqueued task will be executed even if the originating thread never enters a task dispatch method such as wait_for_all().

    A short usage example for task::enqueue():

    class MyTask : public tbb::task {
        /*override*/ tbb::task* execute() {
            // Do the job
            return NULL; // or a pointer to a new task to be executed immediately
        }
    };
    
    MyTask* t = new (tbb::task::allocate_root()) MyTask();
    tbb::task::enqueue(*t);
    // Do other job; the task will be executed asynchronously
    

    As @JimMishell mentioned in the comment, an example how to use it for handling of GUI events can be found in “Design Patterns”; and the formal description of the method is available in the Reference manual (see TBB documentation for both).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get the base 10 logarithm of a Fixnum using Ruby, but
Possible Duplicate: Return value from thread I want to get the free memory of
I want to get started doing some game development using Microsoft's XNA. Part of
I want to get my databases under version control. I'll always want to have
I want to write a server using a pool of worker threads and an
I want the Windows thread pool (QueueUserWorkItem()) to call my class' member functions. Unfortunately
I use ThreadPoolExecutor to manage a thread pool. What we want are: if the
i want to get list of all application or Threads attached with a process.For
I want get the time used for a case so I can create an
I want get all of the Geom objects that are related to a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.