Changes between Version 2 and Version 3 of ModParrotArchitecture
- Timestamp:
- 11/21/08 18:16:13 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ModParrotArchitecture
v2 v3 1 NOTE: This is a work in progress. 2 3 = Overview = 4 5 This 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 1 7 = Terminology = 2 8 … … 10 16 = Design Goals = 11 17 12 * Provide a nParrot interface to the Apache API and data structures18 * Provide a Parrot interface to the Apache API and data structures 13 19 * HLL modules require no C code 14 20 * Remain invisible to the end user 21 * Become the primary platform for mod_perl6 development 15 22 16 23 = mod_parrot Module = 17 24 25 The 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 27 The module alone provides no HLL layers, and thus no real functionality by itself. 28 29 After 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 18 35 == Contexts == 19 36 37 A 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 54 The 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 56 To maintain state, the same context must be used for all phases of a request, as it contains a reference to the interpreter. 57 20 58 == Interpreter Management == 59 60 Contexts 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 66 Interpreters are created 21 67 22 68 = Apache Interface =