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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:05:13+00:00 2026-06-07T22:05:13+00:00

While using OpenMP threads, Each thread can declare its own set of private variables.

  • 0

While using OpenMP threads,

  1. Each thread can declare its own set of private variables. Is it correct to assume,
    that fetching data, which are private to each thread, has lower latency than fetching data visible
    to all threads. In other words, are the thread local variables cached ?

  2. Say each thread, wants to use a thread private STL data container like std::vector. In single threaded C++
    code, data in the std::vector is stored on the heap. What about the multi-threaded case ?
    Are the data of the thread-private std::vectors still stored on the heap ?

  • 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-07T22:05:16+00:00Added an answer on June 7, 2026 at 10:05 pm

    Unless you’re using a NUMA machine, memory is uniform.

    Is it correct to assume, that fetching data, which are private to each
    thread, has lower latency than fetching data visible to all threads.

    Thread-local storage isn’t inherently “faster” than memory that is visible to all threads. However, memory that is only used by one thread is less likely to suffer from cache coherency effects – since it is only accessed by a single thread.

    In other words, are the thread local variables cached?

    Not necessarily. And it definitely won’t be the case if it doesn’t fit in the CPU cache. It is also possible for shared data to be in the caches of multiple cores at the same time.

    What about the multi-threaded case ? Are the data of the
    thread-private std::vectors still stored on the heap ?

    Yes, they will be in the heap regardless of the number of threads.

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

Sidebar

Related Questions

While using Intent object we can put different types of data directly using its
While using :first-child :last-child , in css its works fine in IE7, FF. Is
While using boost::threads I have come across this interruption problem. When I do a
I am parallelizing several separated for-loops using OpenMP. While debugging in gdb, I found
while using database under MySQL how can i determine my current MySQL version,database name
While using listbox in c#, how can learn the count of selecteditems? Listbox items:
While using AvAudio Player How can we achieve a song to be played in
While using perl debugger, is there any way to step out of the current
While using Google chrome if I shut down it unexpectedly. like turn of pc
While using Nivo Slider it enlarges my images to about 2x their original size

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.