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

  • SEARCH
  • Home
  • 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 6859767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:19:27+00:00 2026-05-27T02:19:27+00:00

I’m trying to port a C# thread pool into C++ but have encountered some

  • 0

I’m trying to port a C# thread pool into C++ but have encountered some serious problems. Some of the features of the C# thread pool are:

  1. Define the maximum number of concurrent threads explicitly
  2. Each thread is defined using a AutoResetEvent
  3. Each workitem in the thread are overloaded so that it can have delegate functions as its private members.

For example,

private static void RunOrBlock(WorkItem workitem) {
  workItem.ThreadIndex = WaitHandle.WaitAny(threadUnoccupied);
  ThreadPool.QueueUserWorkItem(threadWorker, workItem);
}

private static void threadWorker(object o) {
  WorkItem workItem = (workItem) o;
  workItem.Run();
  threadUnoccupied[workItem.ThreadIndex].Set();
}

WorkItem is defined as:

public abstract class WorkItem {
  protected int threadIndex;
  public abstract void Run();
  public int ThreadIndex {
    get { return threadIndex; }
    set { threadIndex = value; } 
  }

Does someone know if there exists a open-source threading pool that has similar functionalities? If not, what will be the correct way to implement such a threading pool? Thanks!

  • 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-27T02:19:28+00:00Added an answer on May 27, 2026 at 2:19 am

    I’m not certain about their specific functionalities, but for open source threadpools in c++ look at boost threadpool or zthreads.

    If you just need a threadpool like functionality and have a compiler which supports it, you could also just use openmp 3.0 tasks. This is what I would choose if possible, since "boost" threadpool didn’t look very convincing at a glance (so might have quite a bit of overhead) and it seems like zthreads isn’t actively developed anymore (at least at first glance, I’m not 100% sure).

    In the not exactly foss, but might be usable if you can live with the licensing (or are ready to invest quite a bit of money…) Intel Threading Building Blocks is pretty much treadpool based

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.