All MagickWand methods are Thread safe

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Locked
ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

All MagickWand methods are Thread safe

Post by ArunKumar »

MagickWandGenesis();
MagickWandTerminus();

NewMagickWand();
DestroyMagickWand

MagickReadImage()
MagickWriteImage()

MagickResizeImage()

I'm using the above magickwand method the resize the image
Is all the above methods are thread safe(i.e is able to use this method for multithread operation)?

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: All MagickWand methods are Thread safe

Post by magick »

All calls in MagickWand are thread safe except for the MagickWandGenesis() and MagickWandTerminus(). Call MagickWandGenesis() before any threads are created and MagickWandTerminus() after all threads are completed. Also, recall many MagickWand methods are already threaded such as MagickResizeImage().

ArunKumar
Posts: 59
Joined: 2020-03-05T00:12:15-07:00
Authentication code: 1152

Re: All MagickWand methods are Thread safe

Post by ArunKumar »

Hence shall I avoid MagickWandGenesis() and MagickWandTerminus() in using my multithreaded program?

will this create any problem If I avoided the MagickWandGenesis() and MagickWandTerminus() method ?

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Re: All MagickWand methods are Thread safe

Post by magick »

Call MagickWandGenesis() at the beginning of your program before you create threads. Call MagickWandTerminus() after all your threads complete and before your program exits. Although ImageMagick will work without these calls, recommended practices requires you use these methods.

Locked