Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

After reading about OpenMP and not finding functions to support semaphores, I did an internet search for OpenMP and the readers and writers problem, but found no suitable matches.

Is there a general method for replacing counting semaphores in OpenMP with something that it supports? Or is there just a gap in the environment where it does not permit things that are asymmetrical like the third readers and writers problem shown on the following page?

http://en.wikipedia.org/wiki/Readers-writers_problem#The_third_readers-writers_problem

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I found your question while looking for an answer myself. That being said, I found the following link: http://bisqwit.iki.fi/story/howto/openmp/

They have a section explaining how to use locks which seems very similar to mutex/semaphore.

Another tool for doing similar things is the critical sections directive even though I don't think it can be used for the reader writer problem because I think it will cause race condition.

Hope this was helpfull :D

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.