Changes between Version 10 and Version 11 of ModParrotArchitecture

Show
Ignore:
Timestamp:
11/29/08 16:18:01 (13 years ago)
Author:
jhorwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotArchitecture

    v10 v11  
    6767 
    6868 
    69 To maintain state, the same context must be used for all phases of a request, as it contains a reference to the interpreter.  When a context is needed, code should call {{{init_ctx(server_rec *s, conn_rec *c)}}}, which will return an available context from the pool.  If {{{conn_rec *c}}} is non-null, {{{init_ctx}}} will return the context bound to that connection, or bind an available connection and return it.  Code in hooks that run before the pre-connection phase should pass a NULL connection. 
     69To maintain state, the same context must be used for all phases of a request, as it contains a reference to the interpreter.  When a context is needed, code should call {{{init_ctx(server_rec *s, conn_rec *c)}}}, which will return an available context from the pool.  If {{{c}}} is non-null, {{{init_ctx}}} will return the context bound to that connection, or bind an available connection and return it.  Code in hooks that run before the pre-connection phase should pass a NULL connection. 
    7070 
    7171When a context is in use, it is locked behind the scenes by {{{reserve_ctx}}}.  While code should not call this function directly, it MUST call {{{release_ctx}}} after each phase is complete to unlock the context.  This may change in the future, as connection binding requires the use of the same context, so all this locking and unlocking is just overhead.