Re: xmldoc() takes ages >>> thread safety.

From: Date: Mon, 05 May 2003 11:02:49 +0000
Subject: Re: xmldoc() takes ages >>> thread safety.
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-1254@lists.php.net to get a copy of this message
Mark J. Hershenson wrote:
Given the size, it seems better to use domxml_open_file() and bypass pulling that all of that data into memory?
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. Any insight would be appreciated. PS. This discussion (more so) also applies to DomDocument->dump_file()

« previous php.internals (#1254) next »