[m-rev.] for review: thread-local mutables

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 12 14:24:23 AEDT 2007


On Fri, 12 Jan 2007, Peter Wang wrote:

> On 2007-01-11, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>>
>> Hi Peter,
>>
>> The main issue I have with this design is the interaction of thread
>> local mutables with parallel conjunction.  The following review comments
>> address leave that issue aside.
>
> I've changed it so that the thread-local mutables array is copied at
> spawn time, and protected the arrays with mutexes.
>
>>> extras/concurrency/spawn.m:
>>> 	Update the spawn/3 implementation to make child threads inherit the
>>> 	thread-local values of the parent.
>>>
>>> 	Make different threads in high-level C grades use different
>>> 	MR_Contexts.  This makes it possible to use the same implementation
>>> 	of
>>> 	thread-local mutables as in the low-level C grades.
>>
>> I think that it's time that spawn/3 (and friends) were moved into the
>> standard library.
>
> What's the preferred way to move files with CVS?  Also, should they be
> contained in a `concurrency' super-module?

Just make a copy and cvs add it in the library module.  (CVS doesn't
really support moving files properly and in any case the history
for the concurrency module doesn't contain anything too important.)

There should be a concurrency module in the standard library.  Whether
or should be called `concurrency' or something else (possibly `thread')
is something that needs to decided.

Moving the concurrency stuff should be a separate change from this
one though.

>>> Index: runtime/mercury_wrapper.c
>>> ===================================================================
>>> RCS file:
>>> /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
>>> retrieving revision 1.177
>>> diff -u -r1.177 mercury_wrapper.c
>>> --- runtime/mercury_wrapper.c	3 Jan 2007 05:17:18 -0000	1.177
>>> +++ runtime/mercury_wrapper.c	10 Jan 2007 02:14:36 -0000
> ...
>>> @@ -600,7 +604,7 @@
>>>        }
>>>    }
>>>  #endif /* ! MR_THREAD_SAFE */
>>> -#endif /* ! MR_HIGHLEVEL_CODE */
>>> +#endif /* ! 0 */
>>
>> Why has this line changed?
>
> The start of the #ifdef block is:
>
>    /*
>    ** XXX The condition here used to be
>    ** #if defined(MR_HIGHLEVEL_CODE) && defined(MR_CONSERVATIVE_GC)
> 	...
>    */
> #if 0
>    MR_init_memory();
>    ...

Okay - actually I've remembered why that is the way it is now.

The rest of that looks fine.  I forgot to mention in my other comments
that the NEWS file should be updated as well.

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