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

Peter Wang wangp at students.csse.unimelb.edu.au
Wed Feb 7 11:09:34 AEDT 2007


On 2007-02-06, doug.auclair at logicaltypes.com <doug.auclair at logicaltypes.com> wrote:
> Dear Julien and Jonathan:
> 
> [...]
> >>> are guarded by a [Melbourne] Mercury generated mutex, and thus 
> >>>are perfectly thread safe.
> 
> Removed warning from README and source code comments [and I read
> the relevant 'Foreign code attribute' section].

The mutex only protects a single foreign_proc at a time.  It doesn't
prevent two instances of read_to_matrix or write_as_tiff from executing
at the same time, for example.  You'd need to get rid of the two globals
in libtiff_io.c and pass them around as parameters.

Peter

--------------------------------------------------------------------------
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