httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: Which thread/process
Date Tue, 14 Sep 1999 16:33:30 GMT


On Sat, 11 Sep 1999, Zeev Suraski wrote:

> On Thu, 12 Aug 1999, Rasmus Lerdorf wrote:
> 
> > > I suggest adding an index field to conn_rec. This number is set by
> > > the MPM after ap_new_connection is called. This way, mod_cgid can work
> > > properly even in an asynchronous threaded server.
> > > 
> > > I'm guessing this field would be useful to other modules as well.
> > > PHP4's TSRM could possibly derive the indices it uses from
> > > conn_rec->index.
> > > 
> > > Thoughts?
> > 
> > That would work for us.
> 
> As far as I recall, that's what Dean wanted to do in the first place.  
> Our problem with it remains as it was - we don't have any access to the
> conn_rec structure from TSRM.  We'll have to figure out a solution once
> Apache 2.0 materializes a bit more.
> 
> Generally, I doubt we'd be able to use anything Apache-specific in TSRM,
> unless Apache will provide a globally-callable function to get a static &
> unique id for the current request.  If that doesn't happen, we'll probably
> have to use pthread_self() or something similar, and give up running on
> some of the mpm hybrids.

we could provide you with a hook which gets called whenever the thread
running a connection changes.  inside that hook you'll have the conn_rec. 
stuff whatever you need into thread-local-memory. 

but actually i don't even think that is required.  because you get the
request_rec or conn_rec *every time your module is called*.  i.e. in your
handler you have it.  you may not have it inside your own code, because
you haven't passed the request_rec structure through to all your own
routines.  but you've got the data you need at the point control passes
from apache to php... so you can stuff something into thread-local-memory
if you need to.

Dean



Mime
View raw message