[mercury-users] announced: libtiff foreign interface (caveats)

Jonathan Morgan jonmmorgan at gmail.com
Tue Feb 6 20:51:17 AEDT 2007


Just a couple of comments.

On 2/4/07, doug.auclair at logicaltypes.com <doug.auclair at logicaltypes.com> wrote:
> Logical Types has built a tiny interface to libtiff to read/write
> RGBA simple images.  It is available at
>
> http://www.logicaltypes.com/share/tiff-matrix-2007-02-03.tgz
>
> From the README:
>
> ----
>
> This is a very small foreign interface to libtiff <http://www.libtiff.org>
> that allows reading and writing of RGBA (Red/Blue/Green/Alpha) TIFF images
> using the matrix protocol (included).
>
> !WARNING! As I note in the foreign implementation, this protocol is
> !WARNING! patently NOT THREAD-SAFE!  So DON'T USE THREADS with this protocol.

I would have thought this should not be a problem, as the functions
you refer to are marked `not_thread_safe'.  This should mean that, if
the library is built in a parallel grade, access to these functions
are guarded by a Mercury generated mutex, and thus are perfectly
thread safe.

I also observe that you use the old C interface.  In general, this
carries the caveat that support may be phased out for it in the
future.  In this case, you also use `pragma import'.  A discussion on
mercury-reviews when specifying `pragma foreign_export' came to the
conclusion that `pragma import' was not used, and so the new foreign
language interface is not likely to include support for this.

Jon
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list