Files.walkFileTree
Alan Bateman
Alan.Bateman at oracle.com
Mon Jul 19 10:05:40 PDT 2010
Benedict Elliott Smith wrote:
> For very large directories it is useful to be able to perform a walk
> with multiple threads - i abandoned this API in a project recently for
> that very reason. Obviously a File.walkFileTreeConcurrently() (or
> similar) method would have to error if any method result was
> SKIP_SIBLINGS, and accept that TERMINATE would not effect an immediate
> stop.
>
> Not sure if you're desperately keen to add such functionality, but it
> might be worth considering while you're looking at it.
>
I'm just fixing up issues with the current walkFileTree method. A
concurrent implementation would be a fun project and clearly an area to
research more before thinking about adding to the Files class. You
probably know this already, but Files.walkFileTree is independent of any
provider and so you should be able to write your own file tree walk
without requiring additional support. It interesting to compare against
using walkFileTree with a single thread that queues tasks to a work queue.
-Alan.
More information about the nio-dev
mailing list