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
精彩评论