4 ms·
My personal disappointment is the lack of expressiveness. Here is a C# LINQ example: using System.Linq; files.AsParallel().ForAll(file => ProcessXML(file)
by alrex021 15y ago
My personal disappointment is the lack of expressiveness.
Here is a C# LINQ example:
using System.Linq;
files.AsParallel().ForAll(file => ProcessXML(file));
To achieve something similar in Java 7, one could start on perhaps with improving the java.util.Collection interface, or appropriate abstract children, by introducing the asParallel method that the Collection implementations could implement. One obvious problem I see is the lack of lambda support in Java 7, so one would have to pass an anonymous class into forXXX(..) instead which is a bit more clunky.
- warmfuzzykitten 15y agoThat falls under project lambda (and corresponding work on the collection classes), which won't appear until Java 8. I agree, it would have been better sooner.
- wmf 15y agoIt doesn't seem like a good idea to ship a "bad" parallel framework in Java 7 and then ship the "good" one two years later in Java 8.