Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29330 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61280 invoked by uid 1010); 8 May 2007 12:48:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61265 invoked from network); 8 May 2007 12:48:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 May 2007 12:48:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.94.239.5 cause and error) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Received: from [82.94.239.5] ([82.94.239.5:50969] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/52-10930-E9170464 for ; Tue, 08 May 2007 08:48:31 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.13.7/8.12.11) with ESMTP id l48CmQiJ011728; Tue, 8 May 2007 14:48:26 +0200 Date: Tue, 8 May 2007 14:48:21 +0200 (CEST) X-X-Sender: derick@kossu.ez.no To: Stanislav Malyshev cc: Lukas Kahwe Smith , Mathias Bank , internals@lists.php.net In-Reply-To: <46406F89.7030000@zend.com> Message-ID: References: <0E.B4.18102.F9DB9264@pb1.pair.com> <463F9FD0.3030009@zend.com> <463FA701.5030707@pooteeweet.org> <46406F89.7030000@zend.com> X-Face: "L'&?Ah3MYF@FB4hU'XhNhLB]222(Lbr2Y@F:GE[OO;"F5p>qtFBl|yVVA&D{A(g3[C}mG:199P+5C'v.M/u@Z\![0b:Mv.[l6[uWl' MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=us-ascii Subject: Re: [PHP-DEV] serialize and cache handling From: derick@php.net (Derick Rethans) 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