3

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

asked Aug 18, 2012 at 9:17

1 Answer 1

4

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

Walter
16.1k8 gold badges60 silver badges95 bronze badges
answered Nov 4, 2012 at 22:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.