Thread-safe file i/o service.