Boost logo

Boost :

Subject: Re: [boost] [parallel_sort] Proposal
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-02-02 16:03:25


Edouard A wrote:
> On Mon, 02 Feb 2009 17:41:58 +0000, "Phil Endecott"
> <spam_from_boost_dev_at_[hidden]> wrote:
>
>> So basically it's something like this:
>>
>> thread t( sort(begin,mid) );
>> sort(mid,end);
>> t.join();
>> merge(begin,mid,end); // [*]
>
> Exactly, with some differences as I do a memory copy before the thread and
> I run two threads.
>
> Working on different buffers allows to prevent hidden system locks when
> you reach the middle.
>
> so it's more like
>
> buffer = new [];
> copy(...)
> thread t1(sort(buffer,...);
>
> buffer2 = new [];
> copy(...)
> thread t2(sort(buffer2, ...);
>
> t2.join();
> t1.join();
>
> merge(buffer, buffer2, result);

That's a lot of extra copying.

What do you mean by "hidden system locks"?

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk