Re: [PECL-DEV] How to cache zval * in HashTable?

[email protected] (xiangchao liu)
Newsgroups php.pecl.dev
Message-ID <[email protected]>
Thanks anybody, i will try to go and find another solution.


On Mon, Aug 9, 2010 at 10:53 PM, Melanie Rhianna Lewis
<[email protected]>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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.