[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:       Alex Bolgarov <oleksiy_alex_bolgarov () yahoo ! com>
Date:       2004-05-13 18:20:00
Message-ID: 20040513182000.59290.qmail () web51307 ! mail ! yahoo ! com
[Download RAW message or body]

 --- Christian Parpart <cparpart@surakware.net> wrote: > -----BEGIN

> 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.
> 
> 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.
> 
> 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.

Even when using threaded MPM, Apache could (and, I think, in most
places would) be configured to run more then one process, each with
several threads. So it really does not matter if you use threaded
or not threaded MPM, for what you want to do you will need to use
shared memory or files on the hard drive or database server.

And yes, I think there is a way to do this with the shared memory,
but again, this would not be simple: how do you map C++ object into
shared memory? What about problems with the
constructors/destructors/virtual function tables/etc... I think the
best bet would be to use shared memory just as array of bytes and
serialize (deserialize) your C++ object to (from) it...

Note that I never used shared memory in Apache modules, so I can't
be considered an expert. 


Thank you, 

    alex.


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

---------------------------------------------------------------------
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