[m-rev.] for review: shift spawn/3 etc, into the standard library

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 16 21:51:38 AEDT 2007


On Mon, 15 Jan 2007, Peter Ross wrote:

> On 1/15/07, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>> 
>> On Tue, 16 Jan 2007, Peter Ross wrote:
>> 
>> > On 1/15/07, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>> >> Shift extras/concurrency/spawn.m into a new standard library module
>> >> named `thread'.
>> >>
>> > Is it really useful to have the spawn primitive in the std library but
>> > no primitives for communicating between threads?
>> 
>> You can use mutables to communicate between threads at the moment since in
>> .par grades the access predicates have the necessary synchronization
>> mechanisms.  (We don't have atomic updates for mutables yet, although we
>> have a design for them - the problem is the "nice" implementation requires
>> polymorphic insts and there is a bug with closures and polymorphic insts at
>> the moment.)
>> 
>> > For me the whole concurrency library should be moved in.
>> 
>> The modules that look useful there are mvar, semaphore and channel.  I
>> can't see any reason not to move them into the standard library, e.g.
>> 
>>         thread.mvar
>>         thread.sempahore
>>         thread.channel
>> 
>> The other modules left in the concurrency library seem less useful,
>> some like, global, just duplicate functionality that's already available
>> in the standard library.
>> 
> mvar and channel are the two I use the most.

channels are implemented in terms of mvars which are implemented in terms
of sempaphores, so if the former are going in so is the latter.  I will
take a look at this after thread module has been added.

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