Changes between Version 11 and Version 12 of ModParrotArchitecture

Show
Ignore:
Timestamp:
11/29/08 16:19:28 (6 years ago)
Author:
jhorwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotArchitecture

    v11 v12  
    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 {{{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 either return the context bound to that connection, or bind and return an available context if none is already bound.  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.