开发者

Are fprintf and fscanf reentrant when using different file handles

Can I have 2 threads in the same process calling fprintf or fscanf at the same time?

One stream is wri开发者_运维问答tten to by the first thread and is read by the second thread and the other stream is read by the first thread and is written to by the second thread. So, I don't have a situation of simultaneous writes or simultaneous reads to the same stream.

If the answer is no - Do I have an reentrant alternative in the printf/scanf family?

This questions follows some comments in: Thread communication via printf and scanf (linux)


They are thread-safe. See http://www.unix.org/whitepapers/reentrant.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜