Hi,
Does anyone know what happens when two processes are simultaneously trying to write to a single file in UNIX (AIX)?
Cheers
Hi,
Does anyone know what happens when two processes are simultaneously trying to write to a single file in UNIX (AIX)?
Cheers
This depends on a lot things. If the processes both opened the file in append mode and really are doing write's, it should work ok. Multiple processes can all write to a common log file this way. Without append mode, they may step on each other. Your thread title mentions file locking. If the processes are using file locking correctly they cannot simultaneously write. If a process has a manditory lock on a file region, another non-root process will block if it attempts a write on that region. Advisory locks can be ignored. "man lockf" should give you more info about file locking.