Critical section

General OpenMP discussion

Critical section

Postby gobbla » Fri May 09, 2008 12:56 am

I would like to know if it is posible to have a critical section in two different files. I mean, if i create a critical section in a file with a name, and another one in another file (same threads are going to go through it), would omp take it as it was only one critical section? And if not, is there any way to have one critical section on two different files?
Thanks for your help.
Ibai Arrizabalaga.
gobbla
 
Posts: 2
Joined: Fri May 09, 2008 12:51 am

Re: Critical section

Postby ejd » Sat May 10, 2008 2:20 pm

If you look at the OpenMP spec, in section 2.7.2 critical Construct, you will see that names have external linkage. The idea here is that if the name is the same for two critical regions, then they will interact just like if they were in the same file. Hope that answers your question.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: Critical section

Postby gobbla » Mon May 12, 2008 2:13 am

ejd wrote:If you look at the OpenMP spec, in section 2.7.2 critical Construct, you will see that names have external linkage. The idea here is that if the name is the same for two critical regions, then they will interact just like if they were in the same file. Hope that answers your question.


It does. Thank you!
gobbla
 
Posts: 2
Joined: Fri May 09, 2008 12:51 am


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 5 guests