OpenMP equivalence to Pthread's pthread_cond_wait?

General OpenMP discussion

OpenMP equivalence to Pthread's pthread_cond_wait?

Postby lancer6238 » Tue Aug 26, 2008 10:19 pm

Hi all,
I'm wondering if there is a OpenMP equivalence to Pthread's pthread_cond_wait and pthread_signal/pthread_broadcast.

I'm trying to write a program that combines MPI and OpenMP, that basically does the following:
I have 2 threads running in each process, one does some work, the other waits for a change in a linked list that the first thread uses. When there is a change in the linked list, this thread will tell other such threads in the other processes, so that they can update their linked list.

I guess what I'm really after is whether it is possible to have one thread in one process communicate with another thread in another process, when certain conditions are met.

Thank you.


Re: OpenMP equivalence to Pthread's pthread_cond_wait?

Postby lfm » Thu Aug 28, 2008 12:06 pm

You can do this using locks. OpenMP doesn't say whether or not threads spin or sleep while awaiting locks, though OpenMP 3.0 does have a hint environment variable that might help. There is no equivalent to pthread_cond_wait/pthread_cond_broadcast. In some cases tasks may give you similar functionality but only if the task pattern fits your code (which it doesn't seem to in this case).
Posts: 135
Joined: Sun Oct 21, 2007 4:58 pm
Location: OpenMP ARB

Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot] and 4 guests