Re: non-stop generational modperl config update strategies?

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Wednesday 21 April 2010 16:59:01 Perrin Harkins wrote:
> In both cases you have the same drawback: it's impossible to read
> anything from the shared data without copying the data you read into
> perl variables.  A shared database only saves memory if you don't need
> all of the data to handle a request.
> 
no, MMapDB creates read-only variables that reference the mmapped block. It 
manipulates SvPVX directly:

sv=newSV(0);
SvUPGRADE(sv, SVt_PV);
SvPOK_only(sv);
SvPV_set(sv, pointer);
SvLEN_set(sv, 0);         # this makes sure perl won't try to free() the space
SvCUR_set(sv, length);
SvREADONLY_on(sv);

You can then pass around references to that variable and nothing will be 
copied.

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
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.