I have a C application with many worker threads. It is essential that these do not block so where the worker threads need to write to a file on disk, ...
I just had the exact same problem in a C# program! I had a series of threads that were each generating there own data, and needed to log that data to a file - but the disorganization caused would be aobsolute choas if they program got busy. Unfortunately for you, C does not have a built in mechanism for handling this ...