At any time when you make a system call, there is the possibility of a race condition. This is due to the fact that the kernel connects all the threads in the system and allows you to control the interaction between processes. In this case, another thread in the system may access the same file as your application.
source
share