Reading concurrency flat files is almost unlimited (correct me if I am wrong); but how is concurrency to write? Consider a simple access log entry (for visits) in PHP to add a string of access information completed with\n
fopen(); // in append mode
fwrite();
fclose();
Since we have concurrent visitors, how does the system (one user who is a user of wbserver / php) record view logs at the same time?
My misunderstanding: a function file_put_contents()(which is a shell of three functions) has the ability to lock ( LOCK_EX)? Is this blocking option useful? How will this affect the journal entry?
UPDATE: My question is about how LOCKing initially works / affects logging to a file. I do not compare file_put_contentsand fwrite; even my question is not limited PHP. The issue is locking the file during the recording process.
source
share