Problem with parallel map

Russel Winder russel at russel.org.uk
Sun Mar 6 07:55:20 PST 2011


On Sun, 2011-03-06 at 09:33 -0500, dsimcha wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=5710
> 
> It's a DMD issue.  I've been meaning to report it for a while. 
> Unfortunately making a workaround for it would be a huge PITA at best 
> and impossible in the toughest use cases.

OK, I signed up to the issue, but there seems no way of voting for it to
try and raise its chance of being fixed.

Despite my personal dislike of this use of string to write functions, I
can live with it in this case, so I am not worried about a workaround in
std.parallelism -- though a DMD fix would be good.

Thanks.

> On 3/6/2011 9:12 AM, Russel Winder wrote:
> > David,
> >
> > I am not sure how properly to report this in this review period . . .
> >
> > If I use:
> >
> > 	taskPool.reduce ! ( "a + b" ) ( 0.0 , outputData )
> >
> > then it works.  If however I try:
> >
> >          taskPool.reduce ! ( ( a , b ) { return a + b ; } ) ( 0.0 , outputData )
> >
> > I get:
> >
> >          pi_d2_parallelMap.d(58): Error: template instance cannot use local '__dgliteral1(__T2,__T3)' as parameter to non-global template reduce(functions...)
> >
> > which doesn't really work for me :-((
> >
> > If I try
> >
> > 	taskPool.reduce ! ( function double ( double a , double b ) { return a + b ; } ) ( 0.0 , outputData )
> >
> > then I get:
> >
> >          pi_d2_parallelMap.d(59): Error: function std.parallelism.__funcliteral1 cannot access frame of function pi_d2_parallelMap.execute.__funcliteral1
> >          pi_d2_parallelMap.d(59): Error: function std.parallelism.__funcliteral1 cannot access frame of function pi_d2_parallelMap.execute.__funcliteral1
> >
> > which is just the error I get with the sequential map and so a compiler
> > problem, I just added it for completeness.
> >
> > Thanks.
> >
> 

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110306/fc1f0791/attachment-0001.pgp>


More information about the Digitalmars-d mailing list