AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

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

2004.11.05 01:06 "Re: [Tiff] is libtiff thread-safe?", by Chris Cox

There is a threading issue because the thread which experiences the error is also the one which would normally make use of the detailed error information. When the code which invoked a libtiff function returns, it needs to be able to retrieve the error information so that it can properly inform the user. That means that the libtiff warning/error callback must store the error info in some thread-specific place so that it may be retrieved once the libtiff function returns. If the functions provided a pointer to user context then the error information could simply be stored there, without any need to use an OS-specific thread-API function to support thread-specific storage.

Also, if you want to go the simple route:

printf is not very threadsafe -- it may not crash, but calling it from multiple threads will rarely do what you expect.

Chris