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

Multithread deleting files

Eugene91

Lurker
Oct 13, 2014
1
0
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:
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones