Can two separate threads access a single file at the same time using ifstream?
If so, is it also possible for one thread to write to it with ofstream while the other is reading from it? I'd like to avoid using mutexes if possible.
Considering that all sane operating systems don't even allow multiple programs to access a file at the same time (unless all are reading), I would say no. Why do you want to do this?
You can, of course, have multiple read-only views of a file.
It's really two different processes rather than threads. My mistake. A bunch of data is retrieved from an online source and saved. It needs to be accessed by both processes. I could just have both of them get the data, but it seems like a waste of space and cpu ^