What do I lose by disabling threads?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
mi
Posts: 123
Joined: 2005-01-25T14:14:43-07:00
Contact:

What do I lose by disabling threads?

Post by mi »

Hello!

What's the penalty for `--disable-threads'? After upgrading the FreeBSD port of ImageMagick, I received a bug-report from a user, who was unable to use PerlMagick, because their perl was built without threads.

I'm thinking about simply adding `--disable-threads' to CONFIGURE_ARGS -- this seems to work with both threaded and non-threaded perl.

What is the penalty?

Could `configure', when it analyzes the available perl installation, also determine, whether threads are supported?..

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

Re: What do I lose by disabling threads?

Post by magick »

ImageMagick works fine without threads. However, a number of the ImageMagick language wrappers defined here: http://www.imagemagick.org/script/api.php assume a threaded environment and their applications will crash and burn when they call ImageMagick methods from more than one thread of execution. With threads enabled, ImageMagick applies numerous mutex locks to serialize the splay-tree, hash, list methods, generating Wand ids, etc.

It may be possible the get PerlMagick to build even if ImageMagick is threaded. We will need to investigate further.

We could enhance the configure script to automatically disable threads if Perl is not threaded. We will need to investigate further.
User avatar
mi
Posts: 123
Joined: 2005-01-25T14:14:43-07:00
Contact:

Re: What do I lose by disabling threads?

Post by mi »

magick wrote:We could enhance the configure script to automatically disable threads if Perl is not threaded. We will need to investigate further.
Please, do. Users are reporting the following problems:

Code: Select all

t/bzlib/write.....Can't load 
'/usr/ports/graphics/ImageMagick/work/ImageMagick-6.3.5/PerlMagick/blib/arch/auto/Image/Magick/Magick.so' 
for module Image::Magick: /usr/local/lib/libIlmThread.so.4: Undefined 
symbol "pthread_join" at /usr/local/lib/perl5/5.8.8/mach/DynaLoader.pm 
line 230.
  at t/bzlib/write.t line 10
Compilation failed in require at t/bzlib/write.t line 10.
BEGIN failed--compilation aborted at t/bzlib/write.t line 10.
Deep recursion on subroutine "Image::Magick::AUTOLOAD" at 
/usr/ports/graphics/ImageMagick/work/ImageMagick-6.3.5/PerlMagick/blib/lib/Image/Magick.pm 
line 42.
Out of memory during request for 112 bytes, total sbrk() is 536811520 bytes!
t/bzlib/write.....dubious
         Test returned status 0 (wstat 139, 0x8b)
DIED. FAILED test 1
         Failed 1/1 tests, 0.00% okay
The initial problem of not being able to load the Magick.so (due to missing symbol) is compounded by perl consumming all available memory -- a reaction, apparently, unique to PerlMagick.

The source of the problem in the above message is OpenEXR's libIlmThread.so.4. Using EXR requires threading, I suppose...
Post Reply