On 7 Jan 2011 17:36, "Russel Winder" <rus...@russel.org.uk> wrote: > > On Fri, 2011-01-07 at 05:22 -0800, Casper Bang wrote: > [ . . . ] > > In C#,thanks to closures, if you determine your for loop has no side- > > effects and needs to go faster, you just use Parallel.For(...) instead > > and the runtime will take care of the rest. That's simple and easy, > > all you need to understand is whether your loop body lends itself to > > parallelization since this is obviously outside the ability of the > > compiler* to magically infer. > > > > *Here we're talking mainstream imperative Java/C#, not Haskell/ML/ > > Clojure/Scala or other experimental languages, AFAIK this is still > > called The Java Posse. > > I guess it is all down to what Oracle does about jsr166y and extras166y. > jsr166y is supposed to be in Java 7 and helps a lot, but ParallelArray > (which is what you need for the above functionality) is only in > extra166y which is what is proposed to not to be in Java 7. > > So campaign to get Parallel Arrays into Java 7. >
No way is that happening, parallel arrays were the primary driver for closures in java. Until we get closures, all bets are off... > In the meantime you can use GPars (http://gpars.codehaus.org) which can > be used direct from Java even though it is a Groovy-based system. > > -- > Russel. > ============================================================================= > Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net <sip%3arussel.win...@ekiga.net> > 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk > London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javapo...@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.