Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: sharing a complex set of objects between httpd processes

by thpfft (Chaplain)
on Mar 15, 2003 at 03:29 UTC ( [id://243244]=note: print w/replies, xml ) Need Help??


in reply to Re: sharing a complex set of objects between httpd processes
in thread sharing a complex set of objects between httpd processes

Thank you (both): very clear and helpful.

The short answer is that I may well not need the singleton at all: it came from a quite possibly misguided idea of what would be an elegant and economical way to manage the proliferation of Class::DBI subclasses.

I'm beginning to see that it's a relic of old bad cgi thinking. The fifty or so require()s involved in loading all the cdbi subclasses made the construction of the factory object seem much heavier than it really is, since all that presumably gets compiled away at the beginning. If I make sure the Template object and DBI handles are being managed sensibly, the difference made by the singleton is probably negligible.

The one thing that I do need to share out among all the processes - apart from the database classes, which can look after themselves - is a new tied-DB-based inverted index. But that will actually get easier, I think, if I don't try and hang on to the factory object after a request has been processed.

pardon me thinking out loud: i always find that making a fool of myself in public is the best way to lend urgency to the tired brain :(

  • Comment on Re: Re: sharing a complex set of objects between httpd processes

Replies are listed 'Best First'.
Re: Re: Re: sharing a complex set of objects between httpd processes
by perrin (Chancellor) on Mar 16, 2003 at 19:41 UTC
    You are correct: require() and use() calls are basically free in mod_perl. Not sure what the implications are for the inverted index you mentioned. If it's in an RDBMS, you obviously have no problem. If it's in a dbm, you should consider using MLDBM::Sync for it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243244]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found