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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:43:45+00:00 2026-05-17T23:43:45+00:00

I’m new to multithreading and I’m working on parallelizing an area in my application.

  • 0

I’m new to multithreading and I’m working on parallelizing an area in my application. I’ve read a number of posts on this site but I’m still confused as to the best way to approach my problem:

[1] In .NET 3.5, is ThreadPool the only way for a program to exploit the multi-cores in the machine ? i.e. Is it possible to spawn threads on different cores using new Thread() ?

[2] My case: I have List<Calculation>that contains around 80 items, currently processed sequentially. So given that I’m using .NET 3.5 and based on what I’ve read, ThreadPool is probably my best bet for multithreading due to the high number of threads, however:

  • There is a lot of dependency between the Calculations. Currently, the list is ordered in a way that all required Calculations are performed in the beginning.

This is how the dependency of the work items looks like (details not important, just wanted to make a point on the complexity of the dependencies):

alt text

  • Calculation times are vastly different, one Calculation object might just involve retrieval of a value , other Calculation objects would involve a lot of work in nested loops…etc

How do I prioritize the main Calculations that have something like 10+ other work items depending on it ? What is the most efficient way of signaling to use ?

Thank you.

Edit: I should mention that List<Calculation> remains fixed. However, computing the 80+ calculations is called x million times. Every time an iterator is updated, Calculate() is invoked on every Calculation in the list.

  • 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-17T23:43:45+00:00Added an answer on May 17, 2026 at 11:43 pm

    [1] In .NET 3.5, is ThreadPool the only way for a program to exploit the multi-cores in the machine ? i.e. Is it possible to spawn threads on different cores using new Thread() ?

    It’s up to the operating system to decide which core a thread should run on. The OS will per default distribute threads evenly over multiple cores (at least in windows).

    ThreadPool are using the same kind of threads as the Thread class, as there really are only one kind (but different types of classes and algorithms wrapping them)

    [2] My case: I have Listthat contains around 80 items, currently processed sequentially. So given that I’m using .NET 3.5 and based on what I’ve read, ThreadPool is probably my best bet for multithreading due to the high number of threads, however:

    Using ThreadPool.QueueWorkItem seems to be the easiest way for you to convert your application.

    Keep in mind that running 100 different threads doesn’t say that your application will be 10 times faster than running 10 threads. It’s more likely that 10 threads will run faster sine a lot if background stuff happens when .net and the OS switches between threads.

    1. I would convert the List into a Queue
    2. When launching your calculations, add 10 (or any number you like) calls to ThreadPool.QueueWorkerItem(MyMethod);
    3. In MyMethod, create a loop that continue to dequeue items from your queue until there are no more jobs left.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.