Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12140 invoked from network); 19 Jan 2014 10:52:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2014 10:52:06 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:50540] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/48-61840-45EABD25 for ; Sun, 19 Jan 2014 05:52:05 -0500 Received: by mail-wg0-f44.google.com with SMTP id l18so6005875wgh.35 for ; Sun, 19 Jan 2014 02:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uBATtAtfnoKb34jqfAnF5WPXw+irwk35TMXJoY6kSMM=; b=uVRxXX/Vl0c7X/mbLWmo6UKUW2cFP48aSQt6iiVTSex5+85sXxa9Eq08wWJwVF2BTx b7IVfap4ajLTiLLtrBC70XyJkn67TS4O5yLHrK31l3Yl4BSZZ6FMaherSD7aKNc5nvE+ UPxYOREhDwv4KHDnPFbglvIv+r2MLsCkCBHHe58cNSlvgaeeaN4ZN0xoWWjdotPA8b2K pJh10gK6uu0POhMCRChR6bIRPLZtgRa1gG02wtyKhyVi6ENYzK2WIqhCcSHDLRteKsqN ybkZSGweAb5IwnpQ/LEstAxm8Jqs2wGnEkTTqXLGuvRzozuomxrG9Wrnu3D4kNAqYoLs Rbpg== MIME-Version: 1.0 X-Received: by 10.194.86.200 with SMTP id r8mr1082543wjz.49.1390128722121; Sun, 19 Jan 2014 02:52:02 -0800 (PST) Received: by 10.227.32.135 with HTTP; Sun, 19 Jan 2014 02:52:02 -0800 (PST) In-Reply-To: References: <52DAEC41.7020107@php.net> Date: Sun, 19 Jan 2014 05:52:02 -0500 Message-ID: To: Lin Yo-An Cc: Joe Watkins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e010d8612ac983e04f05090dc Subject: Re: [PHP-DEV] Re: How to create Persistent zval? From: theanomaly.is@gmail.com (Sherif Ramadan) --089e010d8612ac983e04f05090dc Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jan 19, 2014 at 1:16 AM, Lin Yo-An wrote: > Thanks again for the detailed answers and your patience. =] > > Just want to make sure the mechanism here: > > 1. an object can not be persistent even the object is allocated with > pemalloc? > I actually have tried using pemalloc then init an object few days ago, > and it doesn't work. > > 2. an zend object can not be allocated persistently because its property > HashTable or handlers is not allocated persistently by default? > > 3. if so, objects must be serialized to string? > > 4. what about array? can I make the array persistent with pemalloc > allocation and without serialization? > > > Thank you so much > Yo-An Lin > http://github.com/c9s > > Sending this message on behalf of Joe as he's having technical difficulties sending to the list... ---- 1) We have no support for a persistent objects store, whatever you put in the objects store has a request lifecycle. 2) Correct, a zend object cannot be persistent, as 1). 3) Actual objects, in the sense of zend_objects in the object store (EG(objects_store)), must be serialized. 4) A HashTable, one that is not used as the properties of an object in EG(objects_store) can be persistent, and doesn't have to be serialized. https://github.com/krakjoe/apcu/blob/simplify/apc_cache.c#L1164 Above is the function that copies HashTables to shared memory for APC https://github.com/krakjoe/apcu/blob/simplify/apc_cache.c#L1309 Above is the callback function passed to my_copy_hashtable as copy_fn, note that only objects are serialized by this code, nothing else. Cheers Joe --089e010d8612ac983e04f05090dc--