mod_slotmem_plain.xml revision ee64d217c5a5f10d4bd69487cdc5612c0ddd8fd1
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<?xml version="1.0"?>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<!-- $LastChangedRevision$ -->
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<!--
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse Licensed to the Apache Software Foundation (ASF) under one or more
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse contributor license agreements. See the NOTICE file distributed with
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse this work for additional information regarding copyright ownership.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse The ASF licenses this file to You under the Apache License, Version 2.0
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse (the "License"); you may not use this file except in compliance with
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse the License. You may obtain a copy of the License at
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse http://www.apache.org/licenses/LICENSE-2.0
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse Unless required by applicable law or agreed to in writing, software
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse distributed under the License is distributed on an "AS IS" BASIS,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse See the License for the specific language governing permissions and
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse limitations under the License.
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse-->
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<modulesynopsis metafile="mod_slotmem_plain.xml.meta">
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<name>mod_slotmem_plain</name>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<description>Slot-based shared memory provider.</description>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<status>Extension</status>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<sourcefile>mod_slotmem_plain.c</sourcefile>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse<identifier>slotmem_plain_module</identifier>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse<summary>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <p><code>mod_slotmem_plain</code> is a memory provider which
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse provides for creation and access to a plain memory segment
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse in which the datasets are organized in "slots."
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse </p>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <p>If the memory needs to be shared between threads and
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse processes, a better provider would be
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <module>mod_slotmem_shm</module>.
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse </p>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <p><code>mod_slotmem_plain</code> provides the following API functions:
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse </p>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dl>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dt>apr_status_t doall(ap_slotmem_instance_t *s, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool)</dt>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dd>call the callback on all worker slots</dd>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dt>apr_status_t create(ap_slotmem_instance_t **new, const char *name, apr_size_t item_size, unsigned int item_num, ap_slotmem_type_t type, apr_pool_t *pool)</dt>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dd>create a new slotmem with each item size is item_size.</dd>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dt>apr_status_t attach(ap_slotmem_instance_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool)</dt>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dd>attach to an existing slotmem.</dd>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dt>apr_status_t dptr(ap_slotmem_instance_t *s, unsigned int item_id, void**mem)</dt>
d86ef5503dcbc38e87c0e03cd3e1f16458cb6323rse <dd>get the direct pointer to the memory associated with this worker slot.</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_status_t get(ap_slotmem_instance_t *s, unsigned int item_id, unsigned char *dest, apr_size_t dest_len)</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>get/read the memory from this slot to dest</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_status_t put(ap_slotmem_instance_t *slot, unsigned int item_id, unsigned char *src, apr_size_t src_len)</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>put/write the data from src to this slot</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>unsigned int num_slots(ap_slotmem_instance_t *s)</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>return the total number of slots in the segment</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_size_t slot_size(ap_slotmem_instance_t *s)</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>return the total data size, in bytes, of a slot in the segment</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_status_t grab(ap_slotmem_instance_t *s, unsigned int *item_id);</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>grab or allocate a slot and mark as in-use (does not do any data copying)</dd>
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_status_t fgrab(ap_slotmem_instance_t *s, unsigned int item_id);</dt>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dd>forced grab or allocate a slot and mark as in-use (does not do any data copying)</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <dt>apr_status_t release(ap_slotmem_instance_t *s, unsigned int item_id);</dt>
05413593151a238718198cc04ca849b2426be106rse <dd>release or free a slot and mark as not in-use (does not do any data copying)</dd>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse </dl>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</summary>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</modulesynopsis>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse