On 5/10/13 10:45 PM, Felipe Gomes wrote: > Hi, does OS.File guarantees that write tasks that have started will be > completed if a shutdown occurs? My use case is for writeAtomic but I'm > interested about the behavior of both write and writeAtomic. > Corner case: what if I call write/writeAtomic from an xpcom-shutdown observer?
In theory: - every call to OS.File queued *before* xpcom-shutdown will be completed; - every call to OS.File queued after xpcom-sthudown will throw an asynchronous exception (once bug 845190 has landed). Note, however, that this has not been thoroughly tested yet. > Another question: are the write tasks queued and completed in order, or can > two writeAtomic calls to the same file race each other and the 2nd call > finish first (only to have the 1st call finish and write older data) All tasks to OS.File are queued and completed in order. Cheers, David -- David Rajchenbach-Teller, PhD Performance Team, Mozilla _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform