[m-rev.] for review: work stealing for parallel conjunctions

Peter Wang novalazy at gmail.com
Wed Nov 26 13:32:40 AEDT 2008


On 2008-11-25, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>
> On Fri, 7 Nov 2008, Peter Wang wrote:
>
...
>>
>> Only tested on x86-64, which has a relatively constrained memory model.
>
> You should check that it works on plain old x86 as well before
> committing.
>

>> /*
>> -** The run queue and spark queue are protected and signalled with the
>> -** same lock and condition variable.
>> -**
>> -** The single sync term lock is used to prevent races in MR_join_and_continue.
>> -** The holder of the sync term lock may acquire the runqueue lock but not vice
>> -** versa.  (We could also have one sync term lock per context, and make
>> -** MR_join_and_continue acquire the sync term lock of the context that
>> -** originated the parallel conjunction, but contention for the single lock
>> -** doesn't seem to be an issue.)
>> +** The run queue is protected with MR_runqueue_lock and signalled
>> +** MR_runqueue_cond.
>
> signalled by?
>

Fixed.

>> +/* Search for a ready context which we can handle. */
>> +static MR_Context *
>> +MR_find_ready_context(MercuryThread thd, MR_Unsigned depth)
>> +{
>> +    MR_Context  *cur;
>> +    MR_Context  *prev;
>> +
>> +    cur = MR_runqueue_head;
>> +    /* XXX check pending io */
>
> Meaning?
>

That was there before, I just moved the code.  Apparently it was once
intended for a blocking i/o call to suspend the context so the engine
could do something else.

>>
>> +  /* XXX this is meaningless now */
>> +  #define MR_choose_parallel_over_sequential_cond(target_cpus) (MR_TRUE)
>> +
>
> You should mention why it cannot be removed yet - because
> compiler/granularity.m will still generate references to it.
>
> Doesn't the above make the granularity transformation redundant?  If so,
> why keep it?

Yes, it should be removed.

> The diff looked fine to me otherwise.  Is there anyway to get the old
> behaviour?

No.

> If not, then it's probably worth tagging the repository
> before committing this change.

Ok.

Peter

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