mod_slotmem_shm.html.en revision 888cb40bdeec5abf452bd85d6bf63b26d5913d4c
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<?xml version="1.0" encoding="ISO-8859-1"?>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
23bd88d6bfcb5a6d1140e68c159d14264cb5d41bJason Vincent This file is generated from xml source: DO NOT EDIT
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos -->
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<title>mod_slotmem_shm - Apache HTTP Server</title>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<script src="/style/scripts/prettify.js" type="text/javascript">
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos</script>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<link href="/images/favicon.ico" rel="shortcut icon" /></head>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<body>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<div id="page-header">
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<p class="apache">Apache HTTP Server Version 2.5</p>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<img alt="" src="/images/feather.gif" /></div>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<div id="path">
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<div id="page-content">
9414015dda290f99570edc01b6dbe98f0f4c49c7Laszlo Hordos<div id="preamble"><h1>Apache Module mod_slotmem_shm</h1>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<div class="toplang">
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<p><span>Available Languages: </span><a href="/en/mod/mod_slotmem_shm.html" title="English">&nbsp;en&nbsp;</a></p>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan</div>
95a1999c80b3861230dabc65b91d0b802a3b62f0Paul Bryan<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Slot-based shared memory provider.</td></tr>
5d968e809e05272e10f85f43b2e4d230af912fecBrendan Miller<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>mod_slotmem_shm_module</td></tr>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_slotmem_shm.c</td></tr></table>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan<h3>Summary</h3>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos <p><code>mod_slotmem_shm</code> is a memory provider which
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos provides for creation and access to a shared memory segment
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos in which the datasets are organized in "slots."
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos </p>
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos <p>All shared memory is cleared and cleaned with each
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos restart, whether graceful or not. The data itself is
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos stored and restored within a file noted by the <code>name</code>
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos parameter in the <code>create</code> and <code>attach</code>
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos calls. If not specified with an absolute path, the file will be
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos created relative to the path specified by the
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos <code class="directive"><a href="/mod/core.html#defaultruntimedir">DefaultRuntimeDir</a></code> directive.
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos </p>
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos <p><code>mod_slotmem_shm</code> provides the following API functions:
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos </p>
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos
e9aaa1f1adc6f718befc047fe7177bdf52198c3aLaszlo Hordos <dl>
fd25b99368235181964a13861fbd7bb0a210ddc8Bruno Lavit <dt>apr_status_t doall(ap_slotmem_instance_t *s, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool)</dt>
fd25b99368235181964a13861fbd7bb0a210ddc8Bruno Lavit <dd>call the callback on all worker slots</dd>
fd25b99368235181964a13861fbd7bb0a210ddc8Bruno Lavit
0389b442e8bd8d112b977faae238cc8bb66201e2Bruno Lavit <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>
0389b442e8bd8d112b977faae238cc8bb66201e2Bruno Lavit <dd>create a new slotmem with each item size is item_size. <code>name</code> is the filename for the persistent store of
0389b442e8bd8d112b977faae238cc8bb66201e2Bruno Lavit the shared memory. Values are:
f1aa66113fa700d874f2c4c38e87c6ce44dae232Bruno Lavit <dl>
f1aa66113fa700d874f2c4c38e87c6ce44dae232Bruno Lavit <dt><code>"none"</code></dt>
fd25b99368235181964a13861fbd7bb0a210ddc8Bruno Lavit <dd><code>Does not persist shared memory in file.</code></dd>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan <dt><code>"file-name"</code></dt>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan <dd><code>[DefaultRuntimeDir]/file-name</code></dd>
1965c5d21403c3d66eb1efa29c670378311b1077Paul Bryan <dt><code>"/absolute-file-name"</code></dt>
29b501990ace032d7b959ac1afd1ec75533e8baePaul Bryan <dd><code>Absolute file name</code></dd>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit </dl></dd>
0fdda69ce3627d501e4bb3103765f676bb1ab061Laszlo Hordos
43689602ee8a67deb29ea8412c48410dcaa6b30aLaszlo Hordos <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>
376d1bf8f8ca562eecccbf0a0d34aa7c7352e152Laszlo Hordos <dd>attach to an existing slotmem. See <code>create</code> for description of <code>name</code> parameter.</dd>
376d1bf8f8ca562eecccbf0a0d34aa7c7352e152Laszlo Hordos
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit <dt>apr_status_t dptr(ap_slotmem_instance_t *s, unsigned int item_id, void**mem)</dt>
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos <dd>get the direct pointer to the memory associated with this worker slot.</dd>
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos <dt>apr_status_t get(ap_slotmem_instance_t *s, unsigned int item_id, unsigned char *dest, apr_size_t dest_len)</dt>
bf3adaa7953ef4d249670fa82f2a0f7f17ee4b7bLaszlo Hordos <dd>get/read the memory from this slot to dest</dd>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit
376d1bf8f8ca562eecccbf0a0d34aa7c7352e152Laszlo Hordos <dt>apr_status_t put(ap_slotmem_instance_t *slot, unsigned int item_id, unsigned char *src, apr_size_t src_len)</dt>
4a3638f833b6a5b87f5979857fb774ca53385cefChad Kienle <dd>put/write the data from src to this slot</dd>
43689602ee8a67deb29ea8412c48410dcaa6b30aLaszlo Hordos
43689602ee8a67deb29ea8412c48410dcaa6b30aLaszlo Hordos <dt>unsigned int num_slots(ap_slotmem_instance_t *s)</dt>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit <dd>return the total number of slots in the segment</dd>
4a3638f833b6a5b87f5979857fb774ca53385cefChad Kienle
4b93fff6cbed4e2ae34e954b9b9bd4f318d34cd4Andi Egloff <dt>apr_size_t slot_size(ap_slotmem_instance_t *s)</dt>
5fc4ae486aef7fabd30ff1d12e8324ca9077b394Andi Egloff <dd>return the total data size, in bytes, of a slot in the segment</dd>
5fc4ae486aef7fabd30ff1d12e8324ca9077b394Andi Egloff
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit <dt>apr_status_t grab(ap_slotmem_instance_t *s, unsigned int item_id);</dt>
5fc4ae486aef7fabd30ff1d12e8324ca9077b394Andi Egloff <dd>grab or allocate a slot and mark as in-use (does not do any data copying)</dd>
fa9b7593e9e156060babbf3a9b06de8d6b5da5a3Laszlo Hordos
11584e05cc53d957ed964dfba41dd3d716f28480Gael Allioux <dt>apr_status_t release(ap_slotmem_instance_t *s, unsigned int item_id);</dt>
11584e05cc53d957ed964dfba41dd3d716f28480Gael Allioux <dd>release or free a slot and mark as not in-use (does not do any data copying)</dd>
11584e05cc53d957ed964dfba41dd3d716f28480Gael Allioux </dl>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit
11584e05cc53d957ed964dfba41dd3d716f28480Gael Allioux</div>
dedea1c74ef770604ee181088cedc7bd891486baAndi Egloff<div id="quickview"><h3 class="directives">Directives</h3>
dedea1c74ef770604ee181088cedc7bd891486baAndi Egloff<p>This module provides no
dedea1c74ef770604ee181088cedc7bd891486baAndi Egloff directives.</p>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit<ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
dedea1c74ef770604ee181088cedc7bd891486baAndi Egloff
fa9b7593e9e156060babbf3a9b06de8d6b5da5a3Laszlo Hordos</div>
3032add8d51a0dcb46e076c4dc6105e78a7c9150Jake Feasel<div class="bottomlang">
3032add8d51a0dcb46e076c4dc6105e78a7c9150Jake Feasel<p><span>Available Languages: </span><a href="/en/mod/mod_slotmem_shm.html" title="English">&nbsp;en&nbsp;</a></p>
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>This section is experimental!</strong><br />Comments placed here should not be expected
3032add8d51a0dcb46e076c4dc6105e78a7c9150Jake Feaselto last beyond the testing phase of this system, nor do we in any way guarantee that we'll read them.</div>
f2f8138695e157f9ce4a11fa2f93d7d44a36d243Laszlo Hordos<script type="text/javascript"><!--//--><![CDATA[//><!--
0fdda69ce3627d501e4bb3103765f676bb1ab061Laszlo Hordosvar disqus_shortname = 'httpd';
0fdda69ce3627d501e4bb3103765f676bb1ab061Laszlo Hordosvar disqus_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_slotmem_shm.html.en';
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit(function(w, d) {
f2f8138695e157f9ce4a11fa2f93d7d44a36d243Laszlo Hordos var disabled = true;
7586bb16914a8a62557e2e56c74a637a451fdd4eAndi Egloff if (w.location.hostname.toLowerCase() == "httpd.apache.org" && disabled !== true) {
7586bb16914a8a62557e2e56c74a637a451fdd4eAndi Egloff d.write('<div id="disqus_thread"><\/div>');
29b501990ace032d7b959ac1afd1ec75533e8baePaul Bryan var s = d.createElement('script');
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit s.type = 'text/javascript';
7586bb16914a8a62557e2e56c74a637a451fdd4eAndi Egloff s.async = true;
5ca0e3ebbca3f4e6e71a985eaaef02346d81df44Laszlo Hordos s.src = 'http' + '://' + disqus_shortname + '.disqus.com/embed.js';
f17bd17365d88d445f029b5859bf524ede9a92f0Andi Egloff (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
f17bd17365d88d445f029b5859bf524ede9a92f0Andi Egloff }
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit else {
5ca0e3ebbca3f4e6e71a985eaaef02346d81df44Laszlo Hordos d.write('<div id="disqus_thread">Comments are disabled for this page at the moment.<\/div>');
44e29ab1a81842519755c5d3b9a3403efad35354Laszlo Hordos }
44e29ab1a81842519755c5d3b9a3403efad35354Laszlo Hordos})(window, document);
44e29ab1a81842519755c5d3b9a3403efad35354Laszlo Hordos//--><!]]></script></div><div id="footer">
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit<p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
44e29ab1a81842519755c5d3b9a3403efad35354Laszlo Hordos<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
43ac19f28eaa5f298d5534a1f4ac21076399f435Phill Cunningtonif (typeof(prettyPrint) !== 'undefined') {
ae79bf818de74e667aa5484483357212e418a68cJamie Nelson prettyPrint();
a4a9bba084e44de2efaad5d022b27673b864fbacAndi Egloff}
b7dc48d3b8b0550ab1e178408299bed5185ab4a1Bruno Lavit//--><!]]></script>
43ac19f28eaa5f298d5534a1f4ac21076399f435Phill Cunnington</body></html>