NAME
Imager::Threads - Imager and threads
SYNOPSIS
use Imager;
use threads;
Imager->preload;
threads->create(...);
DESCRIPTION
Starting from version 0.93 Imager attempts to work safely with perl's ithreads
.
Previous versions stored some state in global variables, in particular the internal error stack.
However there are some limitations:
Imager's debug malloc isn't thread safe and will never be. Imager's debug malloc is disabled by default.
libtiff
, which Imager uses for TIFF file support is not thread safe,Imager::File::TIFF
works around this by single-threading its access tolibtiff
.giflib
, which Imager uses for GIF support is not thread safe before version 5.Imager::File::GIF
works around this by single threading its access togiflib
.killing a thread reading or writing TIFF or GIF files may deadlock other threads when they attempt to read or write TIFF or GIF files.
Note that if you have another module using libtiff
or giflib
it may interact with Imager's use of those libraries in a threaded environment, since there's no way to co-ordinate access to the global information libtiff
and giflib
maintain.
Imager currently doesn't use threads itself.
SEE ALSO
Imager, threads
AUTHOR
Tony Cook <tony@cpan.org>