[m-rev.] for review: coroutining for parallel conjunctions

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Jul 5 00:02:05 AEST 2006


On Tue, 4 Jul 2006, Peter Wang wrote:

> On 2006-07-03, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> >
> > On Fri, 30 Jun 2006, Peter Wang wrote:
> >
> > > By the way, is anyone using asm_fast.par.gc on saturn and earth?
> > > Otherwise I'll change those installations to asm_jump.par.gc, which
> > > don't suffer from the random errors (somehow related to gcc global
> > > registers, GC and whether you link with pthreads statically or not
> > > -- wtf?).
> >
> > Have you tried this on anything other than Linux?
>
> No.  I'm having enough trouble coping with all these grades ;-)

I'll give it a go on OS X the next time I install Mercury on my laptop.
You could also try it on Solaris.


> > > +        /*
> > > +        ** Save this context and put it on the list of suspended contexts for
> > > +        ** this future.
> > > +        */
> > > +        MR_save_context(MR_ENGINE(MR_eng_this_context));
> > > +        MR_ENGINE(MR_eng_this_context)->MR_ctxt_resume = &&wait_resume;
> >
> > Does taking the address of a label work in the none grades? (and the reg
> > ones for that matter).
>
> Oops, thanks for catching it.  I just copied it from
> extras/concurrency/semaphore.m.  Here's another attempt: (trimmed)
>
>
> Add coroutining support for dependent parallel conjunctions in lowlevel
> parallel grades.
>
> library/par_builtin.m:
> 	Change definitions of synchronisation primitives so that waiting on a
> 	future causes the current context to be suspended.  Signalling a
> 	future causes all the contexts waiting on the future to be scheduled.
>
> runtime/mercury_context.c:
> runtime/mercury_thread.c:
> runtime/mercury_thread.h:
> runtime/mercury_wrapper.c:
> 	Add a global `MR_primordial_thread' to hold the thread id of the
> 	primordial thread.

I take it that the primoridal thread is the one that called main/2.
(or more strictly the one that the Mercury runtime began executing in.)

> 	Add sanity checks, in particular that the primordial thread does not
> 	exit like other threads as it needs to clean up the Mercury runtime.
>
> tests/par_conj/Mmakefile:
> 	Actually run dependent parallel conjunction tests since they should
> 	no longer deadlock.
>
> tests/par_conj/*.exp:
> 	Add expected outputs for test cases which didn't have them.

The rest of that looks okay.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list