CVS update: php3/doc/functions
| From: | eschmid | Date: | Mon, 14 Dec 1998 21:38:55 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2803@lists.php.net to get a copy of this message | ||
Date: Monday December 14, 1998 @ 16:38
Author: eschmid
Update of /repository/php3/doc/functions
In directory asf:/u/temp/cvs-serv19354/functions
Modified Files:
sem.sgml
Log Message:
Pulled in shared memory. It works great. Need better and more functional examples.
I'm not sure about the serialize and unserialize functions.
Index: php3/doc/functions/sem.sgml
diff -c php3/doc/functions/sem.sgml:1.1 php3/doc/functions/sem.sgml:1.2
*** php3/doc/functions/sem.sgml:1.1 Tue Nov 17 18:21:20 1998
--- php3/doc/functions/sem.sgml Mon Dec 14 16:38:54 1998
***************
*** 1,6 ****
<reference id="ref.sem">
! <title>Semaphore Functions</title>
<titleabbrev>Semaphore</titleabbrev>
<partintro>
<para>
--- 1,6 ----
<reference id="ref.sem">
! <title>Semaphore and Shared Memory Functions</title>
<titleabbrev>Semaphore</titleabbrev>
<partintro>
<para>
***************
*** 8,13 ****
--- 8,16 ----
Semaphores may be used to provide exclusive access to resources
on the current machine, or to limit the number of processes that
may simultaneously use a resource.
+ <para>
+ Shared memory support is also included. It is compatible with
+ System V compatible systems.
</partintro>
<refentry id="function.sem-get">
***************
*** 20,47 ****
<funcsynopsis>
<funcdef>int <function>sem_get</function></funcdef>
<paramdef>int <parameter>key</parameter></paramdef>
! <paramdef>int
<parameter><optional>max_acquire</optional></parameter></paramdef>
! <paramdef>int
<parameter><optional>perm</optional></parameter></paramdef>
</funcsynopsis>
<para>
Returns: A positive semaphore identifier on success, or false on
error.
<para>
! <function>sem_get</function> returns an id that can be used
! to access the System V semaphore with the given key. The
! semaphore is created if necessary using the permission bits
! specified in perm (defaults to 0666).
! The number of processes that can acquire the semaphore simultaneously
! is set to max_acquire (defaults to 1). Actually this value is set
! only if the process finds it is the only process currently attached
! to the semaphore.
<para>
A second call to <function>sem_get</function> for the same key
! will return a different semaphore identifier, but both identifiers
! access the same underlying semaphore.
<para>
See also: <function>sem_acquire</function> and
! <function>sem_release</function>.
</refsect1>
</refentry>
--- 23,51 ----
<funcsynopsis>
<funcdef>int <function>sem_get</function></funcdef>
<paramdef>int <parameter>key</parameter></paramdef>
! <paramdef>int <parameter><optional>max_acquire</optional>
! </parameter></paramdef>
! <paramdef>int <parameter><optional>perm</optional>
! </parameter></paramdef>
</funcsynopsis>
<para>
Returns: A positive semaphore identifier on success, or false on
error.
<para>
! <function>sem_get</function> returns an id that can be used to
! access the System V semaphore with the given key. The semaphore
! is created if necessary using the permission bits specified in
! perm (defaults to 0666). The number of processes that can
! acquire the semaphore simultaneously is set to max_acquire
! (defaults to 1). Actually this value is set only if the process
! finds it is the only process currently attached to the semaphore.
<para>
A second call to <function>sem_get</function> for the same key
! will return a different semaphore identifier, but both
! identifiers access the same underlying semaphore.
<para>
See also: <function>sem_acquire</function> and
! <function>sem_release</function>.
</refsect1>
</refentry>
***************
*** 99,104 ****
--- 103,225 ----
<function>sem_acquire</function>.
</refsect1>
</refentry>
+
+ <refentry id="function.shm-attach">
+ <refnamediv>
+ <refname>shm_attach</refname>
+ <refpurpose>Creates or open a shared memory</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>shm_attach</function></funcdef>
+ <paramdef>long <parameter>key</parameter></paramdef>
+ <paramdef>long <parameter>memsize</parameter></paramdef>
+ <paramdef>long <parameter>perm</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Creates or open a shared memory with the given key and
+ memsize.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.shm-detach">
+ <refnamediv>
+ <refname>shm_detach</refname>
+ <refpurpose>Disconnects from shared memory</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>shm_detach</function></funcdef>
+ <paramdef>long <parameter>id</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Disconnects from shared memory with the given
+ <parameter>id</parameter> created from
+ <function>shm_attach</function>. Remember, that the shared memory
+ still exist in the Unix system and the data is still present.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.shm-put-var">
+ <refnamediv>
+ <refname>shm_put_var</refname>
+ <refpurpose>Inserts or updates a variable in shared
+ memory</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>shm_put_var</function></funcdef>
+ <paramdef>int <parameter>id</parameter></paramdef>
+ <paramdef>long <parameter>variable_key</parameter></paramdef>
+ <paramdef>mixed <parameter>variable</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Inserts or updates a variable with a given variable_key. All
+ variable-types (double, long, string, array) are supported. The
+ function <function>serialize</function> can be used to store the
+ data.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.shm-get-var">
+ <refnamediv>
+ <refname>shm_put_var</refname>
+ <refpurpose>Reads a variable with a given variable_key
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>mixed <function>shm_get_var</function></funcdef>
+ <paramdef>int <parameter>id</parameter></paramdef>
+ <paramdef>long <parameter>variable_key</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Reads a variable with a given <parameter>variable_key</parameter>.
+ The variable is still present in the shared memory. The function
+ <function>unserialize</function> can be used to decode the data.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.shm-remove-var">
+ <refnamediv>
+ <refname>shm_remove_var</refname>
+ <refpurpose>Removes a variable from shared memory
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>shm_remove_var</function></funcdef>
+ <paramdef>int <parameter>id</parameter></paramdef>
+ <paramdef>long <parameter>variable_key</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Removes a variable with a given <parameter>variable_key</parameter>
+ from shared memory.
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.shm-remove">
+ <refnamediv>
+ <refname>shm_remove</refname>
+ <refpurpose>Removes shared memory</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>shm_remove</function></funcdef>
+ <paramdef>long <parameter>key</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Removes shared memory from the Unix system. All data will be
+ destroyed.
+ </refsect1>
+ </refentry>
+
<!-- Keep this comment at the end of the file
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net