Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-r.b-one.net (mx-r.one.com [91.198.169.249])
	by mail9.b-one.net (Postfix) with ESMTP id CCDF140023E
	for <info@awaresystems.be>; Fri,  6 May 2011 19:33:09 +0200 (CEST)
Received: by mx-r.b-one.net (Postfix, from userid 106)
	id BCD7F544652; Fri,  6 May 2011 19:33:09 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-r.b-one.net (Postfix) with ESMTP id E263A544657 for
 <info@awaresystems.be>; Fri,  6 May 2011 19:33:08 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 2D39C86901; Fri,  6 May 2011
 12:30:44 -0500 (EST)
Received: from mail-wy0-f172.google.com (mail-wy0-f172.google.com
 [74.125.82.172]) by lists.maptools.org (Postfix) with ESMTPS id 44A3486C05
 for <tiff@lists.maptools.org>; Fri,  6 May 2011 12:07:28 -0500 (EST)
Received: by wyb29 with SMTP id 29so2687961wyb.3 for
 <tiff@lists.maptools.org>; Fri, 06 May 2011 10:07:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.197.168 with SMTP id t40mr4043748wen.55.1304701647056;
 Fri, 06 May 2011 10:07:27 -0700 (PDT)
Received: by 10.216.12.65 with HTTP; Fri, 6 May 2011 10:07:26 -0700 (PDT)
In-Reply-To: <alpine.GSO.2.01.1105051512050.15219@freddy.simplesystems.org>
References: <BANLkTimakuNLfthR-C+uYy+mJHm7ug54WQ@mail.gmail.com>
 <4DC2E179.7050309@pobox.com>
 <alpine.GSO.2.01.1105051359070.15219@freddy.simplesystems.org>
 <BANLkTin47-fyVk9=N10AhMrEYXicaQa7Dg@mail.gmail.com>
 <alpine.GSO.2.01.1105051512050.15219@freddy.simplesystems.org>
Date: Fri, 6 May 2011 13:07:26 -0400
Message-ID: <BANLkTi=j_fb+LOySsSKneu3cQkAgjTyBBg@mail.gmail.com>
From: Katerina Sedivy <sedivyk@gmail.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Cc: Tiff List <tiff@lists.maptools.org>
Subject: Re: [Tiff] Is LibTiff 3.9.5 Thread Safe ?
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1409270509=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1409270509==
Content-Type: multipart/alternative; boundary=0016e6dbe59635f03404a29e867c

--0016e6dbe59635f03404a29e867c
Content-Type: text/plain; charset=ISO-8859-1

You are right Bob, Delphi isn't thread safe either without a certain flag
which I already have furthermore because I am using Delphi 6 I had even
changed the memory manager since it is not thread safe as well.

However in file tif_dir.c I found this comment:

        "* This can happen if multiple images are open with different
         * codecs which have private tags.  The global tag information
         * table may then have tags that are valid for one file but not
         * the other. If the client tries to set a tag that is not valid
         * for the image's codec then we'll arrive here.  This
         * happens, for example, when tiffcp is used to convert between
         * compression schemes and codec-specific tags are blindly copied."

I found this comment in the function _TIFFVGetField in the default section
of the switch for the  tags. The same comment exists in the SetField
function.



Katerina



On Thu, May 5, 2011 at 4:16 PM, Bob Friesenhahn <
bfriesen@simple.dallas.tx.us> wrote:

> On Thu, 5 May 2011, Katerina Sedivy wrote:
>
>  <<a bunch of threads requested to open different TIFF files all at the
>> same time>>
>> This is exactly my case
>>
>> <<the library has been exercised at least once>>
>> What do you mean by exercised?
>>
>
> For example, reading or writing a file.
>
> There is no specific thread-safety code in libtiff.  The code is written to
> be re-entrant but there are still some static variables.
>
> On some systems, it is necessary to build code with particular options in
> order to be thread safe (e.g. C library functions may otherwise not be
> thread safe).  Libtiff does not (by itself) provide any such build options.
>
>
> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>

--0016e6dbe59635f03404a29e867c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

You are right Bob, Delphi isn&#39;t thread safe either without a certain fl=
ag which I already have furthermore because I am using Delphi 6 I had even =
changed the memory manager since it is not thread safe as well. <br><br>
However in file tif_dir.c I found this comment:<br><br>=A0=A0=A0 =A0=A0=A0 =
&quot;* This can happen if multiple images are open with different<br>=A0=
=A0=A0 =A0=A0=A0=A0 * codecs which have private tags.=A0 The global tag inf=
ormation<br>=A0=A0=A0 =A0=A0=A0=A0 * table may then have tags that are vali=
d for one file but not<br>
=A0=A0=A0 =A0=A0=A0=A0 * the other. If the client tries to set a tag that i=
s not valid<br>=A0=A0=A0 =A0=A0=A0=A0 * for the image&#39;s codec then we&#=
39;ll arrive here.=A0 This<br>=A0=A0=A0 =A0=A0=A0=A0 * happens, for example=
, when tiffcp is used to convert between<br>
=A0=A0=A0 =A0=A0=A0=A0 * compression schemes and codec-specific tags are bl=
indly copied.&quot; <br>=A0<br>I found this comment in the function _TIFFVG=
etField in the default section of the switch for the=A0 tags. The same comm=
ent exists in the SetField function.<br>
<br><br><br>Katerina<br><br><br><br><div class=3D"gmail_quote">On Thu, May =
5, 2011 at 4:16 PM, Bob Friesenhahn <span dir=3D"ltr">&lt;<a href=3D"mailto=
:bfriesen@simple.dallas.tx.us">bfriesen@simple.dallas.tx.us</a>&gt;</span> =
wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
>On Thu, 5 May 2011, Katerina Sedivy wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&lt;&lt;a bunch of threads requested to open different TIFF files all at th=
e same time&gt;&gt;<br>
This is exactly my case<br>
<br>
&lt;&lt;the library has been exercised at least once&gt;&gt;<br>
What do you mean by exercised?<br>
</blockquote>
<br></div>
For example, reading or writing a file.<br>
<br>
There is no specific thread-safety code in libtiff. =A0The code is written =
to be re-entrant but there are still some static variables.<br>
<br>
On some systems, it is necessary to build code with particular options in o=
rder to be thread safe (e.g. C library functions may otherwise not be threa=
d safe). =A0Libtiff does not (by itself) provide any such build options.<di=
v>
<div></div><div class=3D"h5"><br>
<br>
Bob<br>
-- <br>
Bob Friesenhahn<br>
<a href=3D"mailto:bfriesen@simple.dallas.tx.us" target=3D"_blank">bfriesen@=
simple.dallas.tx.us</a>, <a href=3D"http://www.simplesystems.org/users/bfri=
esen/" target=3D"_blank">http://www.simplesystems.org/users/bfriesen/</a><b=
r>
GraphicsMagick Maintainer, =A0 =A0<a href=3D"http://www.GraphicsMagick.org/=
" target=3D"_blank">http://www.GraphicsMagick.org/</a><br>
</div></div></blockquote></div><br>

--0016e6dbe59635f03404a29e867c--

--===============1409270509==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============1409270509==--
