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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:48:12+00:00 2026-05-13T15:48:12+00:00

Here is the context: I am writing an interpreter in C# for a small

  • 0

Here is the context: I am writing an interpreter in C# for a small programming language called Heron, and it has some primitive list operations which can be executed in parallel.

One of the biggest challenges I am facing is to distribute the work done by the evaluator across the different cores effectively whenever a parallelizable operation is encountered. This can be a short or long operation, it is hard to determine in advance.

One thing that I don’t have to worry about is synchronizing data: the parallel operations are explicitly not allowed to modify data.

So the primary questions I have is:

  • What is the most effective way to distribute the work across threads, so that I can guarantee that the computer will distribute the work across two cores?

I am also interested in a related question:

  • Roughly how long should an operation take before we can start overcoming the overhead of separating the work onto another thread?
  • 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-13T15:48:12+00:00Added an answer on May 13, 2026 at 3:48 pm

    If you want to do a lot with parallel operations, you’re going to want to start with .Net 4.0. Here’s the Parallel Programming for .Net documentation. You’ll want to start here though. .Net 4.0 adds a LOT in terms of multi-core utilization. Here’s a quick example:

    Current 3.5 Serial method:

    for(int i = 0; i < 30000; i++)
    {
      doSomething(i);
    }
    

    New .Net 4.0 Parallel method:

    Parallel.For(0, 30000, (i) => doSomething(i));
    

    The Parallel.For method automatically scales across the number of cores available, you can see how fast you could start taking advantage of this. There are dozens of new libraries in the framework, supporting full thread/task management like your example as well (Including all the piping for syncing, cancellation, etc).

    There are libraries for Parallel LINQ (PLINQ), Task Factories, Task Schedulers and a few others. In short, for the specific task you laid out .Net 4.0 has huge benefits for you, and I’d go ahead and grab the free beta 2 (RC coming soon) and get started. (No, I don’t work for Microsoft…but rarely do I see an upcoming release fulfill a need so perfectly, so I highly recommend .Net 4.0 for you)

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

Sidebar

Related Questions

First here's some context on what I want to achieve. I'm writing a small
Here the context for my question: A common technique is to declare the parameter
Here is my code, which takes two version identifiers in the form 1, 5,
I'm trying to make a meta-language for writing markup code (such as xml and
A little context: I would like to separate the Java application I'm writing into
Here I have: Public Structure MyStruct Public Name as String Public Content as String
Who here is using WASP ( http://wasp.sourceforge.net/content/ ) to in real world applications? What
Here is the input (html, not xml): ... html content ... <tag1> content for
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form

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.