I am communicating with some parallel processes using FIFOs. I am reading the pipe with read(). And I am writing to the named pipe by doing this:
ofstream pipe(namepipe);
pipe << data << endl;
pipe.close();
I have been noticing that the performance is horrible though! It takes like 40ms sometimes. It's an extreme latency in my opinion. I read that the use of std::endl can affect performance. Should I avoid using endl?
Does using ofstream affect performance? Are there any other alternatives to this method?
Thank you!