سؤال

Does OMP ensure that the contents of an dynamic array is up-to-date and is visible to all threads after an OMP barrier?

هل كانت مفيدة؟

المحلول

Yes. A barrier causes all threads' view of all accessible memory to be made consistent; that is, it implicitly flushes the entire state of the program.

نصائح أخرى

if your array is out of the #pragma omp parallel construct, it will automatically accessible & share by all the thread.

But the way he is update by the thread only depend if your algo and the synchro mechanism you use to ensure the correctness.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top