Take the 2-minute tour ×

there is 2 process share a file F,the size of each io is a line which is less than 4k

  • A: read a line from F
  • B: write a line to F (append mode)

I want to konw about if the case below will be happen?

B write half of the line ,then A read from A,and found that eof of F is readed ,and return half of the line.

share|improve this question

1 Answer 1

At a time, file can be used by a single process only. If you want it to be shared between two processes, you have to synchronize them. Also, you have to close the file before used by second process.

share|improve this answer

Your Answer


