Accessing shared data requires dereferencing a pointer?

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the viewtopic.php?f=8&t=465 for book info and to download the examples. Post your feedback about the book and examples to this forum

Accessing shared data requires dereferencing a pointer?

Postby arthur.avramiea » Sun Feb 27, 2011 8:01 am

Page 156 of the book, section 5.5.3 says Private Versus Shared Data it says: Accessing shared data also requires dereferencing a pointer, which incurs a performance overhead.
What I have understood until now is that each thread gets a local copy of the shared data, and it can update the value of the other threads using flush.
In this context, can you help me understand which is the pointer that the book is talking about there?
arthur.avramiea
 
Posts: 6
Joined: Wed Feb 23, 2011 11:43 am

Re: Accessing shared data requires dereferencing a pointer?

Postby ejd » Mon Feb 28, 2011 6:25 pm

Each thread doesn't get a local copy of the shared data. Each thread accesses the shared data, usually through a pointer, and the shared data may be copied into a thread's cache when used. Hope that helps explain the problem you are having with the concept.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am


Return to Using OpenMP - The Book and Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron