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 6944933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:22:16+00:00 2026-05-27T13:22:16+00:00

I wanted to replace the use of normal threads with the task_group class from

  • 0

I wanted to replace the use of normal threads with the task_group class from ppl, but I ran in to the following problem:

  • I have a class A with a task_group member,

  • create 2 different instances of class A,

  • start a task in the task_group of the first A instance (using run),

  • after a few seconds start a task in the task_group of the second A instance.

I’m expecting the two tasks to run in parallel but the second task wait for the first task to finish then starts.

This is happening only in my application where the tasks are started from a static function. I did the same scenario in a test application and the tasks are running correctly in parallel.

After spending several hours trying to figure this out I switched back to normal threads.

Does anyone knows why is the concurrency run-time having this behavior, or how I can avoid this?

EDIT
The problem was that it was running on a single core CPU and concurrency run-time looks at throughput. I wonder if microsoft parallel patterns library has the concept of an active object, or something on the lines so that you can specify that the task you are about to lunch is to be executed in parallel with the thread you start it from…

  • 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-27T13:22:17+00:00Added an answer on May 27, 2026 at 1:22 pm

    The response can be found here: http://social.msdn.microsoft.com/Forums/en/parallelcppnative/thread/85a84373-4c3d-4862-bff3-9a21ffe82493

    For one core machines, this is expected “default” behavior. This can be changed.

    By default, number of tasks that can run in parallel = number of hardware threads (num of cores). This improves the raw throughut and efficiency of completing tasks.

    However, there are a number of situations where a developer would want many tasks running in parallel, regardless of the number of cores. In this case you have two options:

    1. Oversubsribe locally.

    In your example above, you would use

    void lengthyTask()
    
    {
    
        Context::Oversubscribe(true)
    
             ...do a lengthy task  (//OR a blocking task)
    
        Context::Oversubscribe(false)
    
    }
    
    1. Oversubcribe the scheduler when you start the application.

      SchedulerPolicy policy(1, MaxConcurrency, GetProcessorCount() * 2);

      SetDefaultSchedulerPolicy(policy);

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

Sidebar

Related Questions

I have a JAXB setup where I use a @XmlJavaTypeAdapter to replace objects of
I wanted to add more methods to the Calendar from java.util.Calendar, but I'm having
If I wanted to replace the * with a column name, what would it
I am working on setting up a Drupal based website and wanted to replace
For instance, if I wanted to a find and replace with strings containing backward
I wanted to show the users Name Address (see www.ipchicken.com ), but the only
I wanted to generate one fix view using interface builder, but the size of
I'm trying to do something like the following. Let's say i have the following
I just wanted to know how to use C to automatically assign a free
Alright. So I wanted to use a file written in c in c++. I

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.