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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:26:57+00:00 2026-05-30T02:26:57+00:00

I have a large array in RAM and want to read data from it

  • 0

I have a large array in RAM and want to read data from it as fast as possible. Ignore any possible synchronization, I only wonder about the theory.

Is it faster to spread those reads over several threads than just using one?

Edit: the data points are about 20KB each and I can’t predict in which order they are read.

  • 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-30T02:26:58+00:00Added an answer on May 30, 2026 at 2:26 am

    Generally speaking: yes but beware of cache misses.

    Let’s say that you have an int[]: consider partitioning it in ranges of subsequent elements and have each thread get a range of its own (thread1 get from 0 to 127, thread2 from 128 to 255, …).

    When you read one element of the array, the processor core executing the load is most likely to load some of the successive elements of the array in its cache, because most of the times they are going to be needed right after (immagine for (int i =0;;i++) do(arra[i])): if you don’t partition your data in a coarse way, all this work is going to be wasted.

    You can read more about this in the following articles from Joe Duffy:

    • Using concurrency for scalability
    • Solving 11 Likely Problems In Your Multithreaded Code

    Not strictly related: The ‘premature optimization is evil’ myth in particular the part “Understand the order of magnitude that matters”

    As @Alex said, the general rule is that you have to always measure and never assume anything: efficient scalability via concurrency is a complex subject and requires a lot of deep understaing of the underlying architecture.

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

Sidebar

Related Questions

I have a large int[] array and a much smaller int[] array. I want
Hey. I have a very large array and I want to find the Nth
I have a large array (say 512K elements), GPU resident, where only a small
I have a large array of booleans, and I want to pack/unpack them into
I want to be able to have a large master array and refer to
I'm using .NET 2.0 I have a large array of string. I want to
I have a large array of data which I am displaying in a UITable.
I have a large array in C (not C++ if that makes a difference).
I have a large array of vertices, some of them are edges, some are
Imagine you have a large array of floating point numbers, of all kinds of

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.