I need to provide text searching in files in a folder in C++ application with multiple threads. If two threads try to open same file in read only mode will it lead to data races or multiple threads can read files using stream objects.?
std::ifstream ifs ("test.txt"); std::filebuf* inbuf = ifs.rdbuf(); Also the files in the folder are dynamic (someone can put the files in folder while application is running) so if locking is required should I keep it on folder level or for every file lock is required dynamically?