Christian Christian - 9 days ago 6
Android Question

How does android decide which app can first write to the disc?

If two Apps want to write data to the disk, how does Android decide which App get's to write it's data first?

Is it strictly first-come-first-served?

Is there a way to give an App priority so that it get's to write it's data first?

Answer

If two Apps want to write data to the disk, how does Android decide which App get's to write it's data first?

Android does not "decide" anything.

Is it strictly first-come-first-served?

Yes, insofar as there is no control over write order. Android 1.x/2.x used YAFFS2 as a filesystem, and that had a global process-level lock over disk I/O, so there was a strict FIFO approach to the filesystem. Android 3.0 switched to ext4, the same filesystem used in most Linux machines, and on there, multiple processes can perform I/O simultaneously, within the limits of hardware.

Is there a way to give an App priority so that it get's to write it's data first?

Not really. App A cannot tell Android "do not let App B write to disk until the year 2037", for example.