Standard IO is thread-safe. When there is concurrent calls made to a stream, the call will be serially applied to the stream. If an application needs to ensure several calls are performed together without interleaved with calls from other program, it need to lock the file using flockfile(). After the series of calls are issue, unlock the file using funlockfile().
No comments:
Post a Comment