AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.11.04 18:31 "is libtiff thread-safe?", by James Xu
2004.11.04 19:04 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 19:09 "Re: is libtiff thread-safe?", by Chris Losinger
2004.11.04 19:19 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 21:10 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.04 21:20 "Re: is libtiff thread-safe?", by Chris Losinger
2004.11.04 21:35 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 23:09 "Re: is libtiff thread-safe?", by Chris Cox
2004.11.04 23:51 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 00:40 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.05 00:53 "Re: is libtiff thread-safe?", by Phillip Crews
2004.11.05 12:19 "Re: is libtiff thread-safe?", by John Aldridge
2004.11.05 12:50 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 01:06 "Re: is libtiff thread-safe?", by Chris Cox
2004.11.05 09:19 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 14:38 "Re: is libtiff thread-safe?", by Bob Friesenhahn

2004.11.05 12:50 "Re: is libtiff thread-safe?", by Joris Van Damme

> How about this for solving both problems in one go...
>
> Extend the TIFF data structure to contain a pair of function pointers to
> error and warning handling functions. When an error or warning occurs,
> see whether the relevant pointer is NULL, and if so just call the
> existing global function. If it's not NULL, then call the function from
> the TIFF structure instead, passing the TIFF* as an argument. I guess
> there's no need for specific user context for these functions, as the
> TIFFGet/SetClientInfo seems to cover it?

The option to set handlers per TIFF * is not necessary (though, of course, it
doesn't hurt, either).

The only thing really necessary is a TIFF * as an argument to these handlers.
That way, the handlers can indeed retrieve ClientInfo, and thus locate context.

Note that in none of the above the word 'thread' occurs. The assessment of the
problem, and the proposed solution, does not change whether the scheme is
multi-threading or not.

This was all discussed earlier... See http://www.asmail.be/msg0054965642.html
for latest archived discussion, and http://www.asmail.be/msg0054815913.html for
first archived discussion. The best solution proposed in these discussions is
indeed the one you propose here. Passing TIFF * (or even directly ClientInfo) as
an argument to the handlers, is similar to how it is done in LibJpeg, and every
other library I can think of.


Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html