• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Multithread deleting files

Eugene91

Lurker
Good day.Please excuse me if it's stupid question, but is it possible to delete a few files at once with delete()(in java.io.File) method? For example i can create 3 threads and give each thread a file to delete.But will they really delete files simultaneously?(I mean multiple operating on file system at once).
 
Welcome to our AndroidForums, Eugene91 :).

I don't specifically know the answer, but you could try doing a test where you time how long it takes for a serial delete vs. your parallel delete (same number of files, of course) and which one completes faster.

Not sure if Linux has to serialize file space allocation and de-allocation requests (i.e., to keep filesystem integrity, etc.)...:dontknow:
 
Back
Top Bottom