I'm writing a server which has multiple threads serving different requests. Within each thread, log entries should be written to a single common log file. I'm unsure about the fprintf's functionality in this context.
Does the fprintf(log_file, ,) of other threads block until current thread is done with writing to the log_file (actually to the output buffer)?
I'm asking this to understand whether it is necessary to lock that code section. If fprintf blocks, then locking is not necessary, isn't it?
Thanks in advance!