Hi,
My question is with regards to accessing the same text file from multiple threads. The code that each thread runs is in different files. Each thread has a write function. I have a main function (in a separate file) that initiates these threads. I want to open a file (perhaps using ofstream) in my main function, and want the threads I'm issuing to write to this SAME file when their write() function is called.
I have written a single-threaded application that writes to (using ofstream) and reads from (using ifstream) the same file, and then closes this file at the end. However, I'm having problems doing the above.
Any help on this would be highly appreciated.
Many many thanks for your help in advance.
Hoping to hear from you soon...
My question is with regards to accessing the same text file from multiple threads. The code that each thread runs is in different files. Each thread has a write function. I have a main function (in a separate file) that initiates these threads. I want to open a file (perhaps using ofstream) in my main function, and want the threads I'm issuing to write to this SAME file when their write() function is called.
I have written a single-threaded application that writes to (using ofstream) and reads from (using ifstream) the same file, and then closes this file at the end. However, I'm having problems doing the above.
Any help on this would be highly appreciated.
Many many thanks for your help in advance.
Hoping to hear from you soon...