Can I use openmp in C++ objects’ constructors?
What will be done, when there will be a global static object with such constructor?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yes. imagine this to be the same as calling OpenMP function from constructor.
A second point, I do not know, it may depend on implementation. I am fairly certain the pthreads implementation should be okay for global static objects. http://www.terboven.com/download/poster_A0_portrait_neu_formatiert.pdf
Static initialization maybe somewhat difficult to get right, http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12.
keep in mind that static object are initialized before main.