Changes between Version 2 and Version 3 of ModParrotArchitecture

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

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotArchitecture

    v2 v3  
     1NOTE: This is a work in progress. 
     2 
     3= Overview = 
     4 
     5This page describes the various subsystems of mod_parrot, and how they all work together.  It is meant to reflect the current state of mod_parrot and should not be used for future design notes.  As such, it will be kept up to date with mod_parrot trunk. 
     6 
    17= Terminology = 
    28 
     
    1016= Design Goals = 
    1117 
    12  * Provide an Parrot interface to the Apache API and data structures 
     18 * Provide a Parrot interface to the Apache API and data structures 
    1319 * HLL modules require no C code 
    1420 * Remain invisible to the end user 
     21 * Become the primary platform for mod_perl6 development 
    1522 
    1623= mod_parrot Module = 
    1724 
     25The mod_parrot Apache module is the product of compilation, and is usually named {{{mod_parrot.so}}} on Unix systems.  It has a dependency on libparrot.so. 
     26 
     27The module alone provides no HLL layers, and thus no real functionality by itself. 
     28 
     29After installation, the module should be loaded as follows in the Apache configuration: 
     30 
     31{{{LoadModule parrot_module modules/mod_parrot.so}}} 
     32 
     33== Configuration == 
     34 
    1835== Contexts == 
    1936 
     37A context is a data structure that maintains state for mod_parrot during the various phases of a request.  It is defined as {{{modparrot_context}}} in {{{mod_parrot.h}}} and contains the following members: 
     38 
     39 * {{{Parrot_Interp interp}}} - a Parrot interpreter bound to this context 
     40 * {{{Parrot_Interp parent_interp}}} - the parent interpreter (if any) of {{{interp}}} 
     41 * {{{long count}}} - UNUSED 
     42 * {{{int locked}}} - is this context in use? 0=available, 1=in use 
     43 * Various Apache data structures relevant to this request: 
     44   * {{{request_rec *r}}} 
     45   * {{{apr_pool_t *pconf}}} 
     46   * {{{apr_pool_t *plog}}} 
     47   * {{{apr_pool_t *ptemp}}} 
     48   * {{{apr_pool_t *pchild}}} 
     49   * {{{server_rec *s}}} 
     50   * {{{conn_rec *c}}} 
     51   * {{{void *csd}}} 
     52 * {{{int module_index}}} - identifies the current HLL module (index into the server configuration's module_array) 
     53 
     54The Apache data structures are all possible structures that may be passed to a handler.  As a rule, if any of the Apache data structures are in scope, they MUST be populated in the context.  This ensures that HLL metahandlers can access the proper data structures, as only they are only passed the context. 
     55 
     56To maintain state, the same context must be used for all phases of a request, as it contains a reference to the interpreter. 
     57 
    2058== Interpreter Management == 
     59 
     60Contexts are allocated from context pools, which contain a finite number of contexts created at startup.  Contexts contain pointers to Parrot interpreters so this also provides mod_parrot with a pool of interpreters. 
     61 
     62=== Interpreter Lifecycle === 
     63 
     64 
     65 
     66Interpreters are created  
    2167 
    2268= Apache Interface =