Re: Thread safety (was: [PHP-DEV] xmldoc() takes ages)

From: Date: Mon, 05 May 2003 11:10:53 +0000
Subject: Re: Thread safety (was: [PHP-DEV] xmldoc() takes ages)
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-1255@lists.php.net to get a copy of this message
On Mon, 5 May 2003, Terence wrote: > Not so long ago I posted to comp.lang.php to raise the discussion about > thread safety of accessing files with domxml_open_file() (and also other > extension specific file-accessing functions). No one replied but I > wanted to know if it was safer to suck the data into memory while using > flock() on the file so that there was no (less?) danger of getting dirty > reads/writes if the file was being accessed from concurrently running > scripts. > > Of course, using flock() means that you actually have to load the file > into memory first which is obviously bad given your evidence (even when > not using file() and putting it in a very large hash first). > > I'm wandering if it is neccesary to use flock() on ALL filesystem > interactions in a web based (multi-threaded) application. Yes, that's necessary, and not only in multithreaded applications, also in multi-process applications like the Apache webserver. But those questiosn really belong on the php-general@lists.php.net mailinglist. Derick -- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

« previous php.internals (#1255) next »