Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx5.public.one.com ([10.246.18.25])
	by mail6.local.one.com (Dovecot) with LMTP id YKsmN4FDXVlpsQAAsyOMew
	for <filtered@awaresystems.be>; Wed, 05 Jul 2017 20:06:29 +0000
X-HalOne-ID: 6da4ff97-61bd-11e7-bb21-b82a72d82f61
Received: from mail-oi0-f54.google.com (unknown [209.85.218.54])
	by mx5.public.one.com (Halon) with ESMTPS
	id 6da4ff97-61bd-11e7-bb21-b82a72d82f61;
	Wed, 05 Jul 2017 20:06:28 +0000 (UTC)
Received: by mail-oi0-f54.google.com with SMTP id l130so135803048oib.1
        for <filtered@awaresystems.be>; Wed, 05 Jul 2017 13:06:28 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :mime-version:in-reply-to:references:from:date:message-id:to:cc
         :subject:precedence:list-id:list-unsubscribe:list-archive:list-post
         :list-help:list-subscribe:content-transfer-encoding:sender:errors-to;
        bh=e8JnY61JpRNwspHavv1UWO2GsZvsDbNeemQij2zRkWE=;
        b=sAmo64ZdK9/8uRhFyrcNfG1DRZaOLsWRVkpMPuIb9MMYIivoxSNsUNHIBktoVwII51
         hmeiKgOWES3Lhq/wZPfLXZaZE5TrniAwZSWvxVXolmq3JbTRHcQUB+OAiVryF5W3bIxt
         bc9bIN+UcDdkbtX1GKbAPYkYQGJuZJRkxyJNi4ft9HZpnp2Orqh6NJtQphPLimdsx4r9
         GuPC6NJkzZhsPmqgZ8PmeoonALosHZMlhNfi4icv/o7nb44341VC+C10sPk51YRpSEEY
         titVuEswCbWGCD4Qsh+yx8y5uIhTg6+RKDhOryLpdnyFxM3gIbPTm4q5EoqinbiItPxK
         E+4g==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org;       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
X-Gm-Message-State: AKS2vOw1PVRe17TYfvmKF8q0SAbuUuWcH2u/1PgMzUDv2qhJ7Qk38mdv
	UlRL5zcu2Z5es7LhUJDA3wHIOXKdwF2GqM7zfLU7KA==
X-Received: by 10.202.52.4 with SMTP id b4mr24970463oia.221.1499285187074;
        Wed, 05 Jul 2017 13:06:27 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.64.84 with SMTP id n81csp1190890oia;
        Wed, 5 Jul 2017 13:06:25 -0700 (PDT)
X-Received: by 10.28.58.147 with SMTP id h141mr25284013wma.112.1499285185676;
        Wed, 05 Jul 2017 13:06:25 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499285185; cv=none;
        d=google.com; s=arc-20160816;
        b=driq/1rhKQT1qlrKiXSDN/PBQPqIV9Z47hfntjW2AAddEwBIQibJObJkTpc7EWanm8
         q97cmSkbUhEbS6ZwlYvGyB7bwFWtq3kjSxCHz7YopvCDqSmnf6mxVkoGhzRXG9+569n8
         YUzu0i7PB/SWyWLJg1JbGmaV4mpgZQanDqGZrmKL2W5eokXT1Ig6M05e9LBnM+oLnWV+
         wsczoXWmLgyBkYeoUtF8KRhtrWZihNuhdM8xQwcNYi+d2e2lPsE1R0fiNCjgsrSUUbmd
         G6iJeVy+i0vME7kGy6yW5y7ssWIV68Vd9CmZvbE0tgQ8hXSlq6n5IhQqNr+mG7Qhcdyd
         IOAw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help
         :list-post:list-archive:list-unsubscribe:list-id:precedence:subject
         :cc:to:message-id:date:from:references:in-reply-to:mime-version
         :arc-authentication-results;
        bh=e8JnY61JpRNwspHavv1UWO2GsZvsDbNeemQij2zRkWE=;
        b=kBwwfK0W+Hwj8+/N/aHq+C0JRX8DP72EbF2Xjs501X/ZuS6JP2LyGsgHvvdMDaDvU+
         mwpB0KSDTt+7VWOa1S1jjHI60tiQnTwOQ+U7enUEeg3GuZtnkAE5vDIMTGBhC3xFH4uT
         Uo9oIKnhu6cT/QqkHWUzdkHsIMzq4GetA/2X0qHAH2x9Zy4LkQ6tqNyMAF3aEPZ9EWvz
         ewHtQA97RqGynUEUk0ukMbwjtZjKRDro3y2LqQMObY+JwjmPn2lvtc8QZvxtavMfT1Gs
         MPIGl7sEN15QiYyzUHV05I6oscLla9exeWBI0GGovxeRJUQx80182mZcq7nnCU/ITO6g
         X68Q==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id f206si18095060wmf.12.2017.07.05.13.06.24;
        Wed, 05 Jul 2017 13:06:25 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 0712935C07B;
	Wed,  5 Jul 2017 15:05:09 -0500 (EST)
Received: from mail-yb0-f180.google.com (mail-yb0-f180.google.com
	[209.85.213.180])
	by lists.maptools.org (Postfix) with ESMTPS id CA9E935C079
	for <tiff@lists.maptools.org>; Wed,  5 Jul 2017 14:36:11 -0500 (EST)
Received: by mail-yb0-f180.google.com with SMTP id f194so16143154yba.3
	for <tiff@lists.maptools.org>; Wed, 05 Jul 2017 12:36:11 -0700 (PDT)
X-Received: by 10.37.54.31 with SMTP id d31mr35923030yba.165.1499283370521;
	Wed, 05 Jul 2017 12:36:10 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.55.137 with HTTP; Wed, 5 Jul 2017 12:36:09 -0700 (PDT)
In-Reply-To: <595D3526.5060408@osa.pri.ee>
References: <alpine.GSO.2.20.1705211423410.6623@freddy.simplesystems.org>
	<595B7643.5040000@osa.pri.ee> <15146403.Hy9LK3uOdm@even-i700>
	<595B8A52.2050603@osa.pri.ee>
	<alpine.GSO.2.20.1707041336160.14951@freddy.simplesystems.org>
	<80e1053d-8b1a-934e-025b-008fc750cc3b@sidefx.com>
	<CAAcuQeZAkmmRKMp5HbBi1Lr58LzFUMuenw_afHcOPOhZSA6ZJg@mail.gmail.com>
	<595CF066.2060605@osa.pri.ee>
	<CAAcuQeZrny_nQu+SUbmsf3HMvs4EON90zZuDOHi7z9TFC_qDRQ@mail.gmail.com>
	<595D3526.5060408@osa.pri.ee>
From: Olivier Paquet <olivier.paquet@gmail.com>
Date: Wed, 5 Jul 2017 15:36:09 -0400
Message-ID: <CAAcuQeYvwxJogR8uT_PJVwD6oJsJG2GwaEUO-v+GZ6f600chZQ@mail.gmail.com>
To: Paavo Helde <paavo@osa.pri.ee>
Cc: TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] A bug in libtiff error/warning handling
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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

2017-07-05 14:51 GMT-04:00 Paavo Helde <paavo@osa.pri.ee>:
> Do you mean two-step initialization, e.g. first creating an "engine" or
> something, then using this to open TIFF files? That would be very nice
> design! Different libraries (or a single library for that matter) could
> then create multiple "engines" which would be totally independent.
> Future extensions could be added by new API functions which modify the
> engine object.

Yes, that's exactly the idea. It's an explicit container for what are
currently global variables. And indeed even a single library could use
multiple copies, for example to install a different error handler for
every open file. That would make sense for a C++ object wanting to
keep a list of its own errors.

> It should be clearly defined if and how this engine can be accessed from
> multiple threads. If it can, then it must not require any external or
> internal locking when processing the actual TIFF files - if the client
> wants to read or write 20 different TIFF files in parallel, the library
> should support that. Probably the simplest way to achieve that is to
> require that the client does not access the engine in other threads when
> calling mutator methods like TIFFRegisterCODEC().

I think a reasonable requirement is that nothing else is using it
while it is modified. TIFFOpen and everything else using the TIFF
handle should only have read-only access so multiple files can share
it. I think that's more or less how it is with current global
variables. And how you put it in your example.

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