I\'m looking to map a modestly-expensive function onto a large lazy seq in parallel. pmap
is great but i\'m loosing to much to context switching. I think I need
I would look at the Fork/Join library, set to be integrated into JDK 7. It's a lightweight threading model optimized for nonblocking, divide-and-conquer computations over a dataset, using a thread pool, a work-stealing scheduler and green threads.
Some work has been done to wrap the Fork/Join API in the par branch, but it hasn't been merged into main (yet).