AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2016.11.11 14:03 "[Tiff] Global variables in LibTIFF", by Paavo Helde
2016.11.11 14:39 "Re: [Tiff] Global variables in LibTIFF", by Bob Friesenhahn
2016.11.11 14:47 "Re: [Tiff] Global variables in LibTIFF", by Olivier Paquet
2016.11.11 21:32 "Re: [Tiff] Global variables in LibTIFF", by Even Rouault
2016.11.11 22:22 "Re: [Tiff] Global variables in LibTIFF", by Bob Friesenhahn
2016.11.12 00:24 "Re: [Tiff] Global variables in LibTIFF", by Yakov Galka
2016.11.12 14:56 "Re: [Tiff] Global variables in LibTIFF", by Bob Friesenhahn
2016.11.12 16:04 "Re: [Tiff] Global variables in LibTIFF", by Yakov Galka
2016.11.16 12:04 "Re: [Tiff] Global variables in LibTIFF", by Gerben Vos
2016.11.16 12:29 "Re: [Tiff] Global variables in LibTIFF", by Yakov Galka
2016.11.12 20:40 "Re: [Tiff] Global variables in LibTIFF", by Paavo Helde

2016.11.16 12:04 "Re: [Tiff] Global variables in LibTIFF", by Gerben Vos

Why is the context named? It smells like magic behavior at a distance (even though it doesn't seem to be) that the name of the context and the opened tiff are the same.

I did a thread-safety analysis a few years ago, but did not contact the mailing list about it. My implementation ideas for fixing those were more among the lines of those in the patch attached to http://bugzilla.maptools.org/show_bug.cgi?id=2255, except that I thought of calling the context object with the formerly global variables a TIFFContext instead of a TIFFApplication. There would then be a default context (that would still be the, only, global variable) that would be used by code that didn’t create their own context. I don't have an implementation, though.

Here are the main notes from my thread-safety analysis at that time (September 2014; I think it was for libtiff 4.0.3):

Note that there are also a few static variables whose initialization might be a problem in a multithreaded environment, although they always initialize the same data every time.

Gerben.

DISCLAIMER: This e-mail and any attachments are intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential and prohibited from disclosure or unauthorized use under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified, any use, dissemination, or copying of this e-mail or the information contained in this e-mail is strictly prohibited by the sender. If you have received this transmission in error, please return the material received to the sender and delete all copies from your system. This email has been scanned by the Email Security.cloud service.