[concurrency-interest] ParallelFloatArray

Doug Lea dl at cs.oswego.edu
Thu Mar 13 07:13:22 EDT 2008

Holger Hoffstätte wrote:
>> Would you consider adding code generation to the development/build 
>> process? The String Template library that comes with ANTLR seems like 
>> the right kind of solution for this problem. Both the code and the tests 
> A great suggestion. The fastutil library (http://fastutil.dsi.unimi.it/) 
> does exactly that (though not with StringTemplate) and it works very well; 
> the generated code is fully typesafe and even has covariant return types. 

Parallel*Array would encounter problems that they don't though,
because of all the cross-dependencies among classes. For
example pa.withMapping(doubleFunction).withMapping(floatFunction)....
Under anything less than language-level integration of primitives
with generics, we'd need to make some API compromises to avoid
at least some of them. This may still be worth doing though.

BTW, for one-shots of this kind of problem, check out
Paul Tyma's ClassHat: http://www.classhat.com/ (This URL seems
not to be working today.)

> It would certainly drastically reduce the maintenance efforts; I recently 
> checked out the source for jsr166y and was surprised by the huge number of 
> type safety warnings and inconistencies.

Some of these are inevitable any time you mix generics with arrays. But
there are a few needless ones that can/will be removed by adjusting some
parameter types etc.


More information about the Concurrency-interest mailing list