On Jul 29, 2011, at 2:03 PM, Bob Friesenhahn wrote:

> On Fri, 29 Jul 2011, JongAm Park wrote:
>> 
>> is there a problem in calling OpenMP functions in a thread function?
> 
> Possibly there is, however, I recall that your main program uses Objective C. 
>  Perhaps the Objective C runtime does not properly initialize with OpenMP?
> 
> OpenMP does not provide any way to explicitly initialize it.
> 
> Bob


Thanks for your reply.

Right,there is no function like "InitializeOpenMP()", which should be called at 
the beginning.
I set the project to use OpenMP, and if it is just declared statically like :

        Magick::Image myImage;

in a normal method, there is no problem.
Only when they are either created or accessed in a thread function, it causes 
the problem.

Apple's GCC has support for OpenMP and it can be turned on/off from a project 
setting, and I turned it on.
The last time I worked with OpenMP was about 3~5 years ago, and at that moment, 
there was no problem.

Let me do some more experiment.
Maybe current version of GCC/LLVM is broken.
( I tested with GCC, LLVM-GCC, LLVM already. )

Thanks again,

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to