Re: How to cache zval * in HashTable?

From: Date: Tue, 10 Aug 2010 02:22:45 +0000
Subject: Re: How to cache zval * in HashTable?
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-7431@lists.php.net to get a copy of this message
Thanks anybody, i will try to go and find another solution. On Mon, Aug 9, 2010 at 10:53 PM, Melanie Rhianna Lewis <cyberspice@php.net>wrote: > > On 9 Aug 2010, at 06:56, xiangchao liu wrote: > > > Hi, everyone, > > > > I now want to cache zval * in global variable HashTable, so i can > retrieve > > it through requests, codes like below: > > > > php_rockphp.h > > ================================================ > > ZEND_BEGIN_MODULE_GLOBALS(rockphp) > > HashTable global_vars; > > ZEND_END_MODULE_GLOBALS(rockphp) > > > > > > rockphp.c > > =============================================== > > Unfortunately the life time of a global variable is actually determined by > the SAPI that's calling the script. All global variables are dangerous if > you expect them to survive over requests because different SAPIs manage > memory differently. This could be single process/single-thread (cli), > multiple process/single thread (apache 1.3), > multiple-process/multiple-thread (windows) etc. It doesn't matter whether > its a Hashtable, zval or what ever since in the end they're just C > structures. > > I suggest the fastest would be direct storage in to a sqlite memory based > db in shared memory. > > Melanie > > -- Architect, Bokan Technologies BokanTech.com

« previous php.pecl.dev (#7431) next »