User-agent: Mediapartners-Google Disallow: User-agent: * Disallow: /search Allow: / Sitemap: http://nox4developper.blogspot.com/sitemap.xml Nox 4 developper: Attempting Read&Write simultaneously? topic

Attempting Read&Write simultaneously? topic






I'm creating an app that has backround services/broadcast recievers... a lot of seperate threads are running.

What would happen if one thread is writing to file.txt with an FileOutputStream object, and another thread then attempts to write to the same file.txt with another FileOutputStream object?

Would the second thread wait until the first one is finished? Or do I need to implement FileLock in my android app?

Also what happens if I try to read with FileInputStream while another thread is writing to that file with FileOutputStream?

Thanks!

-Brian






Aucun commentaire:

Enregistrer un commentaire