I am working on a program that uses several std::ifstreamto read a binary file, one std::ifstreamfor each stream. Now I need to know if it std::ofstreamis thread safe for Windows and Linux for writing to a single file. I use only one std::ofstreamand use for multiple threads.
I read different blocks using each stream and writing this block to the output file using seekp()and write(). It currently works for me, but whether this is problematic for large files.
Is the thread safe std::ofstream?
source
share