Return-Path: <tiff-bounces@remotesensing.org>
Received: from inav001.isp.belgacom.be (inav001.isp.belgacom.be [195.238.3.91])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id iA51Chae020804
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Nov 2004 02:12:43 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inas005.isp.belgacom.be (localhost [127.0.0.1])
        by inav001.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id iA51CYk7016092
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Nov 2004 02:12:34 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inmx008.isp.belgacom.be (inmx008.isp.belgacom.be [195.238.3.88])
        by inas005.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id iA51CNV8004104
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Nov 2004 02:12:25 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx008.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id iA51CAlq007608
        for <joris.at.lebbeke@skynet.be>; Fri, 5 Nov 2004 02:12:11 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id F0288448B1D; Thu,  4 Nov 2004 20:11:52 -0500 (EST)
X-Original-To: Tiff@remotesensing.org
Delivered-To: Tiff@remotesensing.org
Received: from psmtp.com (exprod6ob7.obsmtp.com [64.18.1.217])
	by xserve.flids.com (Postfix) with SMTP id A43C4448AED
	for <Tiff@remotesensing.org>; Thu,  4 Nov 2004 20:11:47 -0500 (EST)
Received: from source ([192.150.22.7]) by exprod6ob7.obsmtp.com ([64.18.5.12])
	with SMTP; Thu, 04 Nov 2004 17:11:00 PST
Received: from inner-relay-3.corp.adobe.com (inner-relay-3 [153.32.251.51])
	by smtp-relay-7.sea.adobe.com (8.12.10/8.12.10) with ESMTP id
	iA51Bgph017942; Thu, 4 Nov 2004 17:11:42 -0800 (PST)
Received: from calsj-dev (calsj-dev.corp.adobe.com [153.32.1.193])
	by inner-relay-3.corp.adobe.com (8.12.9/8.12.9) with ESMTP id
	iA51Av0a022387; Thu, 4 Nov 2004 17:11:26 -0800 (PST)
Received: from [153.32.48.223] (noname.corp.adobe.com [153.32.48.223])
	by mailsj-v1.corp.adobe.com
	(iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep  8 2003))
	with ESMTP id <0I6O00EXMLYUZ4@mailsj-v1.corp.adobe.com>; Thu,
	04 Nov 2004 17:11:19 -0800 (PST)
Date: Thu, 04 Nov 2004 17:06:43 -0800
From: Chris Cox <ccox@adobe.com>
Subject: Re: [Tiff] is libtiff thread-safe?
In-reply-to: <Pine.SOC.4.60.0411041834110.9670@blade.simplesystems.org>
X-Sender: ccox@mailsj.corp.adobe.com
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>,
        Joris <joris.at.lebbeke@skynet.be>
Message-id: <p0521060dbdb0824c9e15@[153.32.48.223]>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii; format=flowed
Content-transfer-encoding: 7BIT
References: <LOENLAKPHCMDKNAAGBHCAEEECAAA.jxu@cvisiontech.com>
	<Pine.SOC.4.60.0411041303330.9670@blade.simplesystems.org>
	<6.0.0.22.1.20041104140811.02611f48@pop.earthlink.net>
	<Pine.SOC.4.60.0411041311570.9670@blade.simplesystems.org>
	<001101c4c2b2$c5616c40$a304f151@dfgrrxsknr4e>
	<6.0.0.22.1.20041104161558.025fb5a0@pop.earthlink.net>
	<Pine.SOC.4.60.0411041531590.9670@blade.simplesystems.org>
	<p05210608bdb066d92f01@[153.32.48.223]>
	<000f01c4c2c9$2a9f1420$3825c850@dfgrrxsknr4e>
	<Pine.SOC.4.60.0411041834110.9670@blade.simplesystems.org>
Cc: Tiff@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: bb7ccdf88f975233ded0ed1c537e06a2

At 6:40 PM -0600 11/4/04, Bob Friesenhahn wrote:
>On Fri, 5 Nov 2004, Joris wrote:
>
>>>Documenting that issue and suggesting that the callbacks contain a
>>>mutex or critical section (if thread safety is an issue) might be a
>>>good idea.
>>
>>I totally fail to see the connection between the lack of TIFF * 
>>parameter in the
>>callbacks on the one hand, and multi-threading on the other. The 
>>callbacks are
>
>In that case I will attempt to educate you.
>
>>called in the same thread context as the call to LibTiff in which the error
>>occured. There's no threading issue here.
>
>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
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
