file parsing: thread-safe