[dmd-concurrency] Defining shared delegates

Andrei Alexandrescu andrei at erdani.com
Tue Jan 19 14:47:54 PST 2010


Robert Jacques wrote:
> On Tue, 19 Jan 2010 15:20:07 -0500, Andrei Alexandrescu 
> <andrei at erdani.com> wrote:
>> One suggestion about shared delegates: should we take the executive 
>> decision to not define them at all? There's nothing you can do with 
>> delegates that you can't do with classes. Although generally delegates 
>> do justify their existence because they're more comfy than e.g. local 
>> classes, it doesn't strike me as obvious we'll need comparable 
>> convenience when dealing with shared classes.
>>
>> Andrei
> 
> I can express pretty much all of my parallel research algorithms safely 
> using const delegates, I can't express any of them safely using a shared 
> class: I'd have to cast/cowboy everything.

I don't understand. Really a delegate is a class and a class is a 
(multi-faceted) delegate. So if you can do things one way, you should be 
able to do them the other way too.

> I'd think this will be true 
> of most OpenMP / data parallel algorithms. And I think not supporting 
> data parallel algorithms cleanly would be just as bad as not supporting 
> clean message passing.

I'm afraid there is no time for addressing data parallel computing. We 
simply don't have the resources. This may be a bummer, but it's the 
reality. One other real fact that is also a bummer is that the best way 
to add a great contribution to the language right now is to improve on 
the drafts that I'm sending, as opposed to discussing new, tall-order 
ideas. For draft 5 I only got three "act-on" comments, all from Steve.

It will be great to discuss new and large-effort ideas once the book 
goes out. Can't wait. Until then, if you find a comma in the wrong font, 
let me know.


Andrei


More information about the dmd-concurrency mailing list