Re: [PHP3] Re: [PHP-DEV] File locking issues
| From: | Sascha Schumann | Date: | Thu, 06 Jan 2000 05:51:10 +0000 |
| Subject: | Re: [PHP3] Re: [PHP-DEV] File locking issues | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-14297@lists.php.net to get a copy of this message | ||
On Wed, Jan 05, 2000 at 11:58:48PM +0000, Manuel Lemos wrote:
> Ok, thanks. What about in the Windows world? Does it work alike?
Probably.
> Could two processes get to 2) and have one overwrite what the other just
> wrote to the file?
Yes. The first one will write while the second is blocked in
2). When the first one finishes, the lock will be released,
and the second process writes into the file.
> I suppose this prevents a process to write to the file while it is written
> with the former access sequence while one or more processes are reading
> from the file with the later access sequence. I wonder if my concurrency
> analisys is correct.
A write lock can only be aquired, if no read and write locks are held.
A read lock can only be aquired, if no write locks are held.
--
Regards,
Sascha Schumann
Consultant