1. Are you ready for the Galaxy S20? Here is everything we know so far!

Multithread deleting files

Discussion in 'Android Apps & Games' started by Eugene91, Oct 13, 2014.

  1. Eugene91

    Eugene91 Lurker
    Thread Starter

    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).

    1. Download the Forums for Android™ app!


  2. scary alien

    scary alien not really so scary
    VIP Member

    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:

Share This Page