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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:19:26+00:00 2026-06-10T14:19:26+00:00

I found link to this article while was reading Parallel Patterns But I’m a

  • 0

I found link to this article while was reading Parallel Patterns

But I’m a little confused now.

What if every iteration of Parallel.For produces result and stores it as array’s item.
There’s no race condition and no need for synchronization. But cache line must be in sync with all threads what degrades performance. (If I’m not mistaken).

So I’m interested whether ways of performance improvement exist.

  • 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-06-10T14:19:28+00:00Added an answer on June 10, 2026 at 2:19 pm

    What if every iteration of Parallel.For produces result and stores it
    as array’s item.

    In order for false sharing to occur you’d need different threads to access array items that are near to each other.

    In practice, you have a small number of threads (let’s call it C) processing a large array of size N, with N >> C. This means that each thread gets a reasonably large number of items to process. Assuming they can be processed independently, the ideal way to do it is by doing a contiguous split, thus each thread gets consecutive positions in the array. This avoids false sharing pretty well.

    It wouldn’t make sense to process array elements interleaved for example, because that would indeed cause false sharing. It may not always be possible to use the contiguous strategy however, because sometimes load-balancing comes into play. In this case you have to see which is more detrimental: occasional false sharing or bad load-balancing. The discussion is long. I’m sure the underlying TPL scheduler is designed well-enough to obtain the best trade-off.

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

Sidebar

Related Questions

I found this article on partial evaluation which looked pretty cool: (the long link
I found this article ( http://blogs.msdn.com/b/narend/archive/2006/10/13/how-to-extend-linking-and-workitem-ui-with-custom-link-types.aspx ) about link extensibility in TFS 2005. I'm
I found this link Link to another page using Twitter Bootstrap jquery modal in
I found this link on how to embed custom fonts in XAML apps. Is
I have found this link: http://www.jfree.org/forum/viewtopic.php?f=3&t=6314 Its back in 2007 where they agree that
I've search for some solution to my problem and I found this link .
Trying to build openssl-fips-2.0 with NDK, before I was lucky found this link and
I need to make rate option in my android app. I found this link
I found from this link that there are several types of XML parsers in
i have a problem using the Catch Clipboard Events code found on this link

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.