r/cpp_questions • u/promach • Jun 04 '18
OPEN forked processes finish sequence dilemma
I am writing through linux device files to a FPGA hardware in a loopback manner, therefore I expect write process finishes before read process.
Why would read process finish first in host.cpp ?
And why would write process finish first in test.cpp ?
Someone told me to print a message before "continue" before line 94 of host.cpp, but this line is never executed. So this eliminates the possibility of EINTR delaying the write process in host.cpp
What do you guys think ?
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] Jun 04 '18
Whether or not it ends up resolving the particular issue you are facing, you don't get to decide whether or not you code requires it. If your code is expecting a write to finish before doing something else with the file descriptor (like reading) then you need it.