I am curious, in a script, if I want just one convert command to use 1 thread, is there any difference between
MAGICK_THREAD_LIMIT=1 convert ....
and
convert -limit thread 1 ....
Is the former limited to that one convert command or does it continue to the rest of the script?
Threading Question
Re: Threading Question
There is no difference. Both set the thread resource limit to 1 such that all algorithms in ImageMagick run in a single thread regardless of the number of cores the host supports.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Threading Question
But are both limited to one command line within a script?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Threading Question
Unless you actually 'export' the MAGICK_THREAD_LIMIT setting then it will only effect the command it is attached to.
That is
will not effect convert
will only effect the first convert
While or
effects every convert command that follows.
Using the option -limit thread 1 will only effect operations that follow it.
However their is no +limit (reset setting) form for this setting. One of the few setting without a + reset form. You can however either give it a 'number' or the string "unlimited". Though if that is the right 'reset' value for 'thread' I have no idea.
That is
Code: Select all
MAGICK_THREAD_LIMIT=1
convert ....
Code: Select all
MAGICK_THREAD_LIMIT=1 convert ...
convert ...
While
Code: Select all
export MAGICK_THREAD_LIMIT=1
convert ...
Code: Select all
MAGICK_THREAD_LIMIT=1
export MAGICK
convert ....
Using the option -limit thread 1 will only effect operations that follow it.
However their is no +limit (reset setting) form for this setting. One of the few setting without a + reset form. You can however either give it a 'number' or the string "unlimited". Though if that is the right 'reset' value for 'thread' I have no idea.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/