AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2010

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2010.06.17 15:39 "libtiff 4 API/ABI stability?", by Adam Goode
2010.06.17 16:21 "Re: libtiff 4 API/ABI stability?", by Edward Lam
2010.06.17 16:22 "Re: libtiff 4 API/ABI stability?", by Edward Lam
2010.06.17 16:38 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.17 22:06 "Re: libtiff 4 API/ABI stability?", by Edward Lam
2010.06.18 00:13 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.18 13:44 "Re: libtiff 4 API/ABI stability?", by Edward Lam
2010.06.18 17:46 "[PATCH] Build tif_win32.c on Windows except on Cygwin", by Adam Goode
2010.06.18 18:21 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Bob Friesenhahn
2010.06.18 18:32 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Adam Goode
2010.06.18 18:35 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Adam Goode
2010.06.28 13:25 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Edward Lam
2010.06.28 15:54 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Bob Friesenhahn
2010.06.29 11:23 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Andrey Kiselev
2010.06.29 13:46 "Re: [PATCH] Build tif_win32.c on Windows except on Cygwin", by Adam Goode
2010.06.17 16:28 "Re: libtiff 4 API/ABI stability?", by Bob Friesenhahn
2010.06.17 16:34 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.17 16:55 "Re: libtiff 4 API/ABI stability?", by Bob Friesenhahn
2010.06.17 17:15 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.17 18:04 "Re: libtiff 4 API/ABI stability?", by Olivier Paquet
2010.06.17 18:09 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.17 18:47 "Re: libtiff 4 API/ABI stability?", by Bob Friesenhahn
2010.06.17 19:35 "Re: libtiff 4 API/ABI stability?", by Olivier Paquet
2010.06.18 00:33 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.18 01:45 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.18 01:54 "Re: libtiff 4 API/ABI stability?", by Olivier Paquet
2010.06.18 02:00 "Re: libtiff 4 API/ABI stability?", by Adam Goode
2010.06.18 13:32 "Re: libtiff 4 API/ABI stability?", by Edward Lam
2010.06.18 13:54 "Re: libtiff 4 API/ABI stability?", by Olivier Paquet
2010.06.18 02:36 "Re: libtiff 4 API/ABI stability?", by Bob Friesenhahn
2010.06.17 20:14 "Re: libtiff 4 API/ABI stability?", by Tom Lane
2010.06.17 20:35 "Re: libtiff 4 API/ABI stability?", by Bob Friesenhahn
2010.06.18 00:31 "Re: libtiff 4 API/ABI stability?", by Adam Goode

2010.06.18 13:54 "Re: libtiff 4 API/ABI stability?", by Olivier Paquet

On Thu, Jun 17, 2010 at 10:00 PM, Adam Goode <adam@spicenitz.org> wrote:
> On 06/17/2010 09:54 PM, Olivier Paquet wrote:
>
>> That's fine for most operations but at some point (eg. file I/O if it
>> is not memory mapped) we will need synchronization. Which pretty much
>> means linking with pthread. This is why I raised the question: should
>> we do it now or wait until is is actually needed?
>
> For file I/O there are 2 lock-free solutions. The first is dumb but
> works well in practice: do an open/read/close cycle every single time
> you read. I have found that open/close is quite efficient and doesn't
> even register on my kernel profiles that I do for OpenSlide. This is
> totally thread safe.

This sounds like it would be horrible on some network file systems,
involving many more round trips than necessary (essentially doing
synchronization through the remote server).

> The second solution is to employ FILE_FLAG_OVERLAPPED on Windows, or
> pread/pwrite on posix. This is an alternate interface to read or write
> that takes the offset in the call, making file I/O thread safe without
> even the slight overhead of open/close.

This appears much better.

> So with these solutions, I suggest that we don't add threading to
> libtiff yet, especially since the interface on Windows is different from
> pthread.

It is... but so is the interface for your I/O solution. This fix is
also specific to I/O (other issues might pop up) and would probably
need to break the ABI (TIFFClientOpen). It remains a good approach
though.

Anyway, I don't like the idea of pulling in pthread either, I was
simply pointing out that we might unfortunately need it at some point
if we are to have more advanced support for multiple threads. We can
certainly fix current issues without it and avoid it for a long time.
Everyone seems ok with that.

Olivier