Re: serialize and cache handling
| From: | Derick Rethans | Date: | Tue, 08 May 2007 12:48:21 +0000 |
| Subject: | Re: serialize and cache handling | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29330@lists.php.net to get a copy of this message | ||
On Tue, 8 May 2007, Stanislav Malyshev wrote:
> > If we're to add this, make sure writes to the files are atomic.
>
> Does PHP now ensure fwrite is atomic? If it doesn't than writing on serialize
> doesn't change a thing.
Only "a" mode is atomic - per write call; normal fwrites are not.
However, you'd need to write the *whole* file to disk atomically and not
on every fwrite. And you can not first cache it in memory as you then
lose the whole advantage of this idea.
regards,
Derick