D
Daniel Berger
Hi all,
The recent talk of threaded access to a file made me wonder if I could
do the same with a file searching lib (file-find in my case). This is
the basic logic:
paths.each{ |path|
Dir.foreach(path){ |file|
paths << file if file is a directory (and not already searched)
next unless file matches user-supplied pattern
}
}
I thought I setting up a thread queue and spawning a new thread for each
new directory would speed it up, but my (probably poor) attempts to
implement it did not result in any speed improvements, and usually
slowed it down a little bit.
Any suggestions?
Thanks,
Dan
The recent talk of threaded access to a file made me wonder if I could
do the same with a file searching lib (file-find in my case). This is
the basic logic:
paths.each{ |path|
Dir.foreach(path){ |file|
paths << file if file is a directory (and not already searched)
next unless file matches user-supplied pattern
}
}
I thought I setting up a thread queue and spawning a new thread for each
new directory would speed it up, but my (probably poor) attempts to
implement it did not result in any speed improvements, and usually
slowed it down a little bit.
Any suggestions?
Thanks,
Dan