[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modules
Subject:    Re: [apache-modules] shared c++ object between apache requests
From:       Nick Kew <nick () webthing ! com>
Date:       2004-05-13 20:35:18
Message-ID: Pine.LNX.4.53.0405132126230.1716 () hugin ! webthing ! com
[Download RAW message or body]

On Thu, 13 May 2004, Christian Parpart wrote:

> I'd like to share some c++ objects between my apache requests in my apache
> module. So, that is, for remembering semi-permanent data during the requests.

The first answer to that is to store it on the server rec
so from the request_rec, you would use
	ap_get_module_config(r->server->module_config, &your_module) ;

Depending on exactly what you need, that might be sufficient.

> I good start would be, to use the threaded-MPM. That would obiousely work, but
> also not a good advice for longterm use on yet unstable modules.

Hmmm?  I don't follow.

> Is there a way, to do this with shared memory or something else?
> I'm sorry, but I'm very new to shared memory stuff so far.

Well, there is apr_shm to use shared memory.  That's somewhat useful,
provided you don't need to share pointers.  If you do need to share
pointers, you'll either need to redesign (e.g. based on a DBM or SQL
backend) or implement it yourself.  In the latter case, you can
become an instant-hero amongst module developers, because it's firmly
on the wishlist.

-- 
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/

---------------------------------------------------------------------
To unsubscribe, e-mail: apache-modules-unsubscribe@covalent.net
For additional commands, e-mail: apache-modules-help@covalent.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic