Possible Duplicate:
stdout thread-safe in C on Linux?
Say thread1 and thread2 are similar and at the end of their jobs they both printf. Is it thread safe or do they have to lock printf somehow?
Is it related to stdout? What if one does fflush(stdout) after each printf? Does it change anything?
refer to Thread-safety and POSIX.1
Note: Some functions can be reentrant or non-reentrant, depending on their arguments.