[m-rev.] for review: avoid a potential deadlock with io.update_globals/3

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Aug 31 14:03:47 AEST 2006


On Thu, 31 Aug 2006, Peter Wang wrote:

> On 2006-08-30, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> Estimated hours taken: 3
>> Branches: main
>>
>> Avoid a potential deadlock with the recently added library predicate
>> io.update_globals/3.
>
> It looks fine.  What would be the problems with changing globals from
> di/uo modes to plain in/out modes?

I don't think there would be any major problems with doing that, although 
lots of existing code would break in minor ways.

> I notice there is an XXX related to this in io.m,

The XXX is related to the fact that io.get_globals/3 has a uo mode but
of course the value you retrieve isn't unique - there's a reference to
it from the global.

> and it'd only be worse if multiple threads are
> destructively updating a global data structure.

How so?

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



More information about the reviews mailing list