mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
updates to api (0.0.36)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328161 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
d4df7f9534
commit
15cb1d089e
47 changed files with 936 additions and 286 deletions
|
@ -8,17 +8,17 @@
|
|||
<preface xml:id="intro.pthreads">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
pthreads uses the well tested abilities of TSRM and PHP to
|
||||
provide compatible multi-threading capabilities.
|
||||
pthreads uses the well tested abilities of TSRM and PHP to provide object oreintated multi-threading capabilities.
|
||||
</para>
|
||||
</preface>
|
||||
|
||||
&reference.pthreads.setup;
|
||||
&reference.pthreads.constants;
|
||||
&reference.pthreads.examples;
|
||||
&reference.pthreads.thread;
|
||||
&reference.pthreads.worker;
|
||||
&reference.pthreads.stackable;
|
||||
&reference.pthreads.mutex;
|
||||
&reference.pthreads.cond;
|
||||
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -12,27 +12,7 @@
|
|||
<section xml:id="cond.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
The following paragraph is taken from the Posix Thread documentation to
|
||||
explain the purpose of Condition Variables:
|
||||
</para>
|
||||
<para>
|
||||
Condition variables provide yet another way for threads to synchronize.
|
||||
While mutexes implement synchronization by controlling thread access
|
||||
to data, condition variables allow threads to synchronize based upon
|
||||
the actual value of data. Without condition variables, the programmer
|
||||
would need to have threads continually polling (possibly in a critical
|
||||
section), to check if the condition is met. This can be very resource
|
||||
consuming since the thread would be continuously busy in this activity.
|
||||
A condition variable is a way to achieve the same goal without polling.
|
||||
A condition variable is always used in conjunction with a mutex lock.
|
||||
</para>
|
||||
<para>
|
||||
pthreads provides PHP with direct access to a carefully selected subset
|
||||
of Condition Variable functions.
|
||||
</para>
|
||||
<para>
|
||||
Because of their nature, the programmer must take care to destroy
|
||||
Condition Variable handles they are finished with.
|
||||
The static methods contained in the Cond class provide direct access to Posix Condition Variables.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
<link xlink:href="&url.pecl.package;pthreads">&url.pecl.package;pthreads</link>
|
||||
</para>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
5
reference/pthreads/entities.cond.xml
Normal file
5
reference/pthreads/entities.cond.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
&reference.pthreads.cond.broadcast;
|
||||
&reference.pthreads.cond.create;
|
||||
&reference.pthreads.cond.destroy;
|
||||
&reference.pthreads.cond.signal;
|
||||
&reference.pthreads.cond.wait;
|
5
reference/pthreads/entities.mutex.xml
Normal file
5
reference/pthreads/entities.mutex.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
&reference.pthreads.mutex.create;
|
||||
&reference.pthreads.mutex.destroy;
|
||||
&reference.pthreads.mutex.lock;
|
||||
&reference.pthreads.mutex.trylock;
|
||||
&reference.pthreads.mutex.unlock;
|
7
reference/pthreads/entities.stackable.xml
Normal file
7
reference/pthreads/entities.stackable.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
&reference.pthreads.stackable.getcreatorid;
|
||||
&reference.pthreads.stackable.getthreadid;
|
||||
&reference.pthreads.stackable.isrunning;
|
||||
&reference.pthreads.stackable.iswaiting;
|
||||
&reference.pthreads.stackable.notify;
|
||||
&reference.pthreads.stackable.run;
|
||||
&reference.pthreads.stackable.wait;
|
15
reference/pthreads/entities.thread.xml
Normal file
15
reference/pthreads/entities.thread.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
&reference.pthreads.thread.getcount;
|
||||
&reference.pthreads.thread.getcreatorid;
|
||||
&reference.pthreads.thread.getmax;
|
||||
&reference.pthreads.thread.getpeak;
|
||||
&reference.pthreads.thread.getthread;
|
||||
&reference.pthreads.thread.getthreadid;
|
||||
&reference.pthreads.thread.isjoined;
|
||||
&reference.pthreads.thread.isrunning;
|
||||
&reference.pthreads.thread.isstarted;
|
||||
&reference.pthreads.thread.iswaiting;
|
||||
&reference.pthreads.thread.join;
|
||||
&reference.pthreads.thread.notify;
|
||||
&reference.pthreads.thread.run;
|
||||
&reference.pthreads.thread.start;
|
||||
&reference.pthreads.thread.wait;
|
10
reference/pthreads/entities.worker.xml
Normal file
10
reference/pthreads/entities.worker.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
&reference.pthreads.worker.getcreatorid;
|
||||
&reference.pthreads.worker.getstacked;
|
||||
&reference.pthreads.worker.getthreadid;
|
||||
&reference.pthreads.worker.isjoined;
|
||||
&reference.pthreads.worker.iswaiting;
|
||||
&reference.pthreads.worker.join;
|
||||
&reference.pthreads.worker.run;
|
||||
&reference.pthreads.worker.stack;
|
||||
&reference.pthreads.worker.start;
|
||||
&reference.pthreads.worker.unstack;
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.wait" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::wait</refname>
|
||||
<refpurpose>Wait for Notification from the referenced Thread.</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::wait</methodname>
|
||||
<methodparam choice="opt"><type>long</type><parameter>timeout</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Causes the calling thread to block and wait for a call to <function>Thread::notify</function> on the referenced Thread.
|
||||
A reached timeout is regarded as failure.
|
||||
A call to <function>Thread::wait</function> will always result in blocking.
|
||||
The programmer should use state detection methods to avoid programming errors when using synchronization methods, <function>Thread::wait</function>, and <function>Thread::notify</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>An optional timeout in microseconds ( millionths of a second ).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of success.</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -45,7 +45,7 @@
|
|||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Provides system administrators a way to limit the amount of Threads an instance of PHP can create.
|
||||
provides system administrators a way to limit the amount of threads or workers an instance of PHP can create.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -56,7 +56,7 @@
|
|||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Provides system administrators a way to disable importing threads into other context for the purposes of security.
|
||||
provides system administrators a way to disable importing threads from other contexts for security.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -11,15 +11,9 @@
|
|||
<!-- {{{ Mutex intro -->
|
||||
<section xml:id="mutex.intro">
|
||||
&reftitle.intro;
|
||||
<para>The following paragraph was taken, in part, from the Posix Threads documentation:</para>
|
||||
<para>
|
||||
Mutex is an abbreviation for "mutual exclusion". Mutex variables are one of the primary means of implementing thread synchronization and for protecting shared data when multiple writes occur.
|
||||
A mutex variable acts like a "lock" protecting access to a shared data resource. The basic concept of a mutex is that only one thread can lock (or own) a mutex variable at any given time. Thus, even if several threads try to lock a mutex only one thread will be successful. No other thread can own that mutex until the owning thread unlocks that mutex. Threads must "take turns" accessing protected data.
|
||||
Mutex can be used to prevent race conditions.
|
||||
The static methods contained in the Mutex class provide direct access to Posix Mutex functionality.
|
||||
</para>
|
||||
<para>pthreads provides PHP with direct access to a carefully selected subset of Mutex functions.</para>
|
||||
<para>The Mutex created by pthreads for PHP are of an error-checking type where available (PTHREAD_MUTEX_ERRORCHECK), in the alpha stages of development this is the only type of Mutex supported by pthreads.</para>
|
||||
<para>Because of their nature, the programmer must take care to destroy Mutex handles they are finished with.</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
|
|
@ -7,28 +7,25 @@
|
|||
<section xml:id="pthreads.requirements">
|
||||
&reftitle.required;
|
||||
<para>
|
||||
pthreads requires ZTS to be enabled at build time ( --enable-maintainer-zts ).
|
||||
pthreads requires a build of PHP with ZTS enabled ( --enable-maintainer-zts or --enable-zts on Windows )
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="pthreads.installation">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
&pecl.info;
|
||||
<link xlink:href="&url.pecl.package;pthreads">&url.pecl.package;pthreads</link>.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Pre-compiled Windows binaries are available on GitHub
|
||||
</simpara>
|
||||
</note>
|
||||
&no.install;
|
||||
</section>
|
||||
|
||||
&reference.pthreads.ini;
|
||||
<section xml:id="pthreads.configuration">
|
||||
&reftitle.runtime;
|
||||
&no.config;
|
||||
</section>
|
||||
|
||||
<section xml:id="pthreads.resources">
|
||||
&reftitle.resources;
|
||||
&no.resource;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
|
67
reference/pthreads/stackable.xml
Normal file
67
reference/pthreads/stackable.xml
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.stackable" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The Stackable class</title>
|
||||
<titleabbrev>Stackable</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ Stackable intro -->
|
||||
<section xml:id="stackable.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Stackables are tasks that are executed by Worker threads. You can synchronize with, read, and write Stackable objects before, after and during their execution.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="stackable.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>Stackable</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>Stackable</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.stackable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.pthreads.entities.stackable;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,19 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.isrunning" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.getcreatorid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::isRunning</refname>
|
||||
<refpurpose>Tell if the referenced Thread is running.</refpurpose>
|
||||
<refname>Stackable::getCreatorId</refname>
|
||||
<refpurpose>Identification</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::isRunning</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>long</type><methodname>Stackable::getCreatorId</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Will return true if the referenced Thread has been started, and not yet joined by another context.</para>
|
||||
<para>
|
||||
Will return the identity of the Thread that created the referenced Stackable
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A numeric value representing the identity of the creating context
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
@ -1,21 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.notify" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.getthreadid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::notify</refname>
|
||||
<refpurpose>Notify all Threads waiting for the referenced Thread.</refpurpose>
|
||||
<refname>Stackable::getThreadId</refname>
|
||||
<refpurpose>Identification</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::notify</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>long</type><methodname>Stackable::getThreadId</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Notify all Threads waiting for the referenced Thread causing the waiting Threads to continue executing.
|
||||
A call to notify when no Threads are waiting results in blocking until another context call Thread::wait on the referenced Thread.
|
||||
Will return the identity of the Worker Thread executing the referenced Stackable
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -26,10 +25,10 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of success.</para>
|
||||
<para>
|
||||
A numeric value, which can be used within a Stackable to retrieve the Worker Thread executing the object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
|
@ -1,21 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.join" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.isrunning" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::join</refname>
|
||||
<refpurpose>Join with the referenced Thread.</refpurpose>
|
||||
<refname>Stackable::isRunning</refname>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>mixed</type><methodname>ImportedThread::join</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Stackable::isRunning</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Join with the referenced Thread, and, dependant on implementation return to the caller the return value of Thread::run.
|
||||
A Thread can only be joined by one context, the programmer should use state detection to avoid programming error.
|
||||
A Stackable is running when a Worker Thread is executing it
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -27,7 +26,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
@ -1,19 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.iswaiting" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.iswaiting" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::isWaiting</refname>
|
||||
<refpurpose>Tell if the referenced Thread is waiting.</refpurpose>
|
||||
<refname>Stackable::isWaiting</refname>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::isWaiting</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Stackable::isWaiting</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Tell if the referenced Thread is waiting for notification from another context.</para>
|
||||
<para>
|
||||
Tell if the referenced Stackable is waiting for notification
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
@ -1,24 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.isjoined" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.notify" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::isJoined</refname>
|
||||
<refpurpose>Tell if the referenced Thread has been joined.</refpurpose>
|
||||
<refname>Stackable::notify</refname>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>void</type><methodname>ImportedThread::isJoined</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Stackable::notify</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
||||
Sends notification to a Stackable that is waiting
|
||||
</para>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -29,7 +26,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
An integral indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
55
reference/pthreads/stackable/run.xml
Normal file
55
reference/pthreads/stackable/run.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="stackable.run" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Stackable::run</refname>
|
||||
<refpurpose>Execution</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>abstract</modifier> <modifier>public</modifier> <type>mixed</type><methodname>Stackable::run</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The run method of a Stackable is executed by the Worker Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,33 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.isbusy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="stackable.wait" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::isBusy</refname>
|
||||
<refpurpose>Tell if the referenced Thread is busy executing.</refpurpose>
|
||||
<refname>Stackable::wait</refname>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::isBusy</methodname>
|
||||
<void />
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Stackable::wait</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>timeout</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Tell if the referenced Thread is busy executing.
|
||||
A call to <function>Thread::join</function> on a busy Thread could result in significant blocking.
|
||||
A Thread being used as a Worker will always appear busy until a call to <function>Thread::join</function> on the Worker is made.
|
||||
Waits for notification from the Stackable
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An optional timeout in millions of a second.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
An integral indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<section xml:id="thread.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Any object that extends Thread can have the run method executed asynchronously in a Thread.
|
||||
An implementation of a Thread should extend this declaration, implementing the run method. When the start method of that object is called, the run method code will be executed in separate Thread.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -4,20 +4,18 @@
|
|||
<refentry xml:id="thread.getcount" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::getCount</refname>
|
||||
<refpurpose>Return the number of currently executing Threads.</refpurpose>
|
||||
<refpurpose>Statistics</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier>
|
||||
<modifier>public</modifier>
|
||||
<modifier>static</modifier>
|
||||
<type>int</type>
|
||||
<methodname>Thread::getCount</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>Thread::getCount</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Returns the number of currently executing Threads.</para>
|
||||
<para>
|
||||
Will return the number of Threads ( including Workers ) in scope in the current instance of PHP
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -28,10 +26,11 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The number of threads that are currently running.
|
||||
This number does not include any threads that are waiting to be joined, only those that are actively executing.
|
||||
An integral number
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,18 +4,17 @@
|
|||
<refentry xml:id="thread.getmax" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::getMax</refname>
|
||||
<refpurpose>Return the maximum number of Threads an instance of PHP may create.</refpurpose>
|
||||
<refpurpose>Statistics</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>Thread::getMax</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>long</type><methodname>Thread::getMax</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Some system administrators choose to limit the amount of Threads an instance of PHP can create.
|
||||
If the number is set and reached any calls to <function>Thread::start</function> will fail, generating a warning.
|
||||
Will return the maximum number of Threads the current instance is permitted to create
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -26,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>The maximum number of Threads as defined by system administrators.</para>
|
||||
<para>
|
||||
An integral number
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="thread.getpeak" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::getPeak</refname>
|
||||
<refpurpose>Return the peak number of Threads.</refpurpose>
|
||||
<refpurpose>Statistics</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>Thread::getPeak</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>long</type><methodname>Thread::getPeak</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Return the peak number of Threads executing concurrently in the current instance of PHP.
|
||||
Some system administrators choose to limit the amount of Threads an instance of PHP can create.
|
||||
If enabled the maximum number of Threads the current instance can create is returned by a call to <function>Thread::getMax</function>.
|
||||
Will return the peak number of Threads the current instance has executed concurrently
|
||||
</para>
|
||||
<para>What counts as "an instance of PHP" depends on the current environment PHP and pthreads are executing in.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -28,10 +25,10 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>The peak number of Threads the current of PHP has executed.</para>
|
||||
<para>
|
||||
An integral number
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
<refentry xml:id="thread.getthread" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::getThread</refname>
|
||||
<refpurpose>Import a Thread created in another context.</refpurpose>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>ImportedThread</type><methodname>Thread::getThread</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <modifier>static</modifier> <type>mixed</type><methodname>Thread::getThread</methodname>
|
||||
<methodparam><type>string</type><parameter>tid</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>Import a Thread created in another context for the purposes of synchronization.</para>
|
||||
<para>
|
||||
Will return an object representing the thread identified by tid if it can be found executing in the current instance
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -22,7 +24,9 @@
|
|||
<varlistentry>
|
||||
<term><parameter>tid</parameter></term>
|
||||
<listitem>
|
||||
<para>A valid Thread identifier returned by a previous call to <function>Thread::getThreadId</function>.</para>
|
||||
<para>
|
||||
The identity of the Thread or Worker you wish to import into the calling context
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -30,8 +34,11 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>An ImportedThread represetning the Thread referenced by tid, if it can be found in the current instance of PHP.</para>
|
||||
<para>
|
||||
An object of the same type as the requested Thread or Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.getthreadid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::getThreadId</refname>
|
||||
<refpurpose>Get the identifer for a Thread</refpurpose>
|
||||
<refpurpose>Identification</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -13,7 +13,9 @@
|
|||
<modifier>final</modifier> <modifier>public</modifier> <type>long</type><methodname>Thread::getThreadId</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Get the identifier for the refeerenced Thread</para>
|
||||
<para>
|
||||
Will return the identity of the referenced Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,8 +25,12 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>The return value can subsequently be used in a call to <function>Thread::getThread</function> for the purposes of importing into another context.</para>
|
||||
<para>
|
||||
A numeric value representing the identity of the referenced Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.isjoined" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::isJoined</refname>
|
||||
<refpurpose>Tell if the referenced Thread has been joined.</refpurpose>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,9 +14,7 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Tell if a Thread has been joined by another context.
|
||||
A Thread may only be joined with one context currently.
|
||||
A call to <function>Thread::join</function> on a joined Thread will result in failure, and a warning being raised.
|
||||
Tell if the referenced Thread has been joined by another context
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -27,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.isrunning" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::isRunning</refname>
|
||||
<refpurpose>Tell if the referenced Thread is running.</refpurpose>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -13,7 +13,9 @@
|
|||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Thread::isRunning</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Will return true if the referenced Thread has been started, and not yet joined by another context.</para>
|
||||
<para>
|
||||
Tell if the referenced Thread is executing
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,8 +25,12 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.isstarted" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::isStarted</refname>
|
||||
<refpurpose>Tell if the referenced Thread has been started.</refpurpose>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,9 +14,7 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
A Thread does not begin executing until a call to <function>Thread::start</function>.
|
||||
A Thread cannot be started twice with a call to <function>Thread::start</function>.
|
||||
The programmer should take care to avoid potential programming errors by calling state detection methods before attempting synchronization with another Thread.
|
||||
Tell if the referenced Thread has been started
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -27,8 +25,12 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.iswaiting" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::isWaiting</refname>
|
||||
<refpurpose>Tell if the referenced Thread is waiting.</refpurpose>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -13,7 +13,9 @@
|
|||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Thread::isWaiting</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Tell if the referenced Thread is waiting for notification from another context.</para>
|
||||
<para>
|
||||
Tell if the referenced Thread is waiting for notification
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.join" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::join</refname>
|
||||
<refpurpose>Join with the referenced Thread.</refpurpose>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,8 +14,7 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Join with the referenced Thread, and, dependant on implementation return to the caller the return value of Thread::run.
|
||||
A Thread can only be joined by one context, the programmer should use state detection to avoid programming error.
|
||||
Causes the calling context to wait for the referenced Thread to finish executing
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -27,7 +26,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -4,18 +4,17 @@
|
|||
<refentry xml:id="thread.notify" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::notify</refname>
|
||||
<refpurpose>Notify all Threads waiting for the referenced Thread.</refpurpose>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Thread::notify</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Thread::notify</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Notify all Threads waiting for the referenced Thread causing the waiting Threads to continue executing.
|
||||
A call to notify when no Threads are waiting results in blocking until another context calls Thread::wait on the referenced Thread.
|
||||
Send notification to the referenced Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -26,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of success.</para>
|
||||
<para>
|
||||
An integral indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.run" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::run</refname>
|
||||
<refpurpose>This is the method that pthreads runs asynchronously for the programmer.</refpurpose>
|
||||
<refpurpose>Execution</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,9 +14,7 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
A run method is just like any other member function, it has access to any members that were set before the call to <function>Thread::start</function> was made.
|
||||
A run methods return value must be serializeable to be passed as the result of <function>Thread::join</function>.
|
||||
Unserializeable data will generate a warning for the context that calls <function>Thread::join</function>.
|
||||
The run method of a Thread is executed in a Thread when a call to Thread::start is made
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -28,7 +26,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<refentry xml:id="thread.start" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::start</refname>
|
||||
<refpurpose>Start executing the referenced Thread</refpurpose>
|
||||
<refpurpose>Execution</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -14,7 +14,7 @@
|
|||
<methodparam choice="opt"><type>boolean</type><parameter>synchronized</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Start executing the referenced Thread, optionally synchronized with the caller.
|
||||
Will start executing this implementations run method in a seperate Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
<term><parameter>synchronized</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If true, will cause the caller of <function>Thread::start</function> to wait for notification before returning.
|
||||
When true will cause the calling context to wait for notification from the Thread before returning from the call to Thread::start
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A boolean indication of success.
|
||||
A boolean indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="thread.wait" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Thread::wait</refname>
|
||||
<refpurpose>Wait for Notification from the referenced Thread.</refpurpose>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Thread::wait</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Thread::wait</methodname>
|
||||
<methodparam choice="opt"><type>long</type><parameter>timeout</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Causes the calling thread to block and wait for a call to <function>Thread::notify</function> on the referenced Thread.
|
||||
A reached timeout is regarded as failure.
|
||||
A call to <function>Thread::wait</function> will always result in blocking.
|
||||
The programmer should use state detection methods to avoid programming errors when using synchronization methods, <function>Thread::wait</function>, and <function>Thread::notify</function>.
|
||||
Will cause the calling Thread to wait for notification from the referenced Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -27,7 +24,9 @@
|
|||
<varlistentry>
|
||||
<term><parameter>timeout</parameter></term>
|
||||
<listitem>
|
||||
<para>An optional timeout in microseconds ( millionths of a second ).</para>
|
||||
<para>
|
||||
An optional timeout in millionths of a second
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -35,7 +34,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of success.</para>
|
||||
<para>
|
||||
An integral indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
|
|
@ -6,43 +6,48 @@
|
|||
|
||||
<versions>
|
||||
<!-- Methods -->
|
||||
<function name='thread::start' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::run' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::wait' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::notify' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::join' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::isstarted' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::isrunning' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::isjoined' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::iswaiting' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::isbusy' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::stack' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::unstack' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getstacked' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getthread' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getthreadid' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getcount' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getmax' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::getpeak' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::wait' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::notify' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::join' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::isstarted' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::isrunning' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::isjoined' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::iswaiting' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::isbusy' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='importedthread::getstacked' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='mutex::create' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='mutex::lock' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='mutex::trylock' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='mutex::unlock' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='mutex::destroy' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='cond::create' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='cond::signal' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='cond::wait' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='cond::broadcast' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='cond::destroy' from='PECL pthreads >= 0.0.33'/>
|
||||
<function name='thread::start' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::run' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::wait' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::notify' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::join' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::isstarted' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::isrunning' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::isjoined' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::iswaiting' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::getthread' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::getthreadid' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::getcreatorid' from='PECL pthreads >= 0.36'/>
|
||||
<function name='thread::getcount' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::getmax' from='PECL pthreads >= 0.34'/>
|
||||
<function name='thread::getpeak' from='PECL pthreads >= 0.34'/>
|
||||
<function name='worker::start' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::run' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::join' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::getthreadid' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::getcreatorid' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::stack' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::unstack' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::isjoined' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::iswaiting' from='PECL pthreads >= 0.36'/>
|
||||
<function name='worker::getstacked' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::run' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::wait' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::notify' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::isrunning' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::iswaiting' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::getthreadid' from='PECL pthreads >= 0.36'/>
|
||||
<function name='stackable::getcreatorid' from='PECL pthreads >= 0.36'/>
|
||||
<function name='mutex::create' from='PECL pthreads >= 0.34'/>
|
||||
<function name='mutex::lock' from='PECL pthreads >= 0.34'/>
|
||||
<function name='mutex::trylock' from='PECL pthreads >= 0.34'/>
|
||||
<function name='mutex::unlock' from='PECL pthreads >= 0.34'/>
|
||||
<function name='mutex::destroy' from='PECL pthreads >= 0.34'/>
|
||||
<function name='cond::create' from='PECL pthreads >= 0.34'/>
|
||||
<function name='cond::signal' from='PECL pthreads >= 0.34'/>
|
||||
<function name='cond::wait' from='PECL pthreads >= 0.34'/>
|
||||
<function name='cond::broadcast' from='PECL pthreads >= 0.34'/>
|
||||
<function name='cond::destroy' from='PECL pthreads >= 0.34'/>
|
||||
</versions>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
67
reference/pthreads/worker.xml
Normal file
67
reference/pthreads/worker.xml
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.worker" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The Worker class</title>
|
||||
<titleabbrev>Worker</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ Worker intro -->
|
||||
<section xml:id="worker.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Worker Threads have a persistent context, as such should be used over Threads in most cases.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="worker.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>Worker</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>Worker</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.worker')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.pthreads.entities.worker;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
55
reference/pthreads/worker/getcreatorid.xml
Normal file
55
reference/pthreads/worker/getcreatorid.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.getcreatorid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::getCreatorId</refname>
|
||||
<refpurpose>Identification</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>long</type><methodname>Worker::getCreatorId</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Will return the identity of the Thread that created the referenced Thread
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A numeric value representing the identity of the creating context
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,19 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.getstacked" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="worker.getstacked" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::getStacked</refname>
|
||||
<refpurpose>Return the number of items on the referenced Threads stack</refpurpose>
|
||||
<refname>Worker::getStacked</refname>
|
||||
<refpurpose>Stack Analysis</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>ImportedThread::getStacked</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Worker::getStacked</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>Return the number of items waiting to be executed by the referenced Thread.</para>
|
||||
<para>
|
||||
Returns the number of Stackables waiting to be executed by the referenced Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -23,7 +25,9 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>An intergral number representing the number of items left on the stack.</para>
|
||||
<para>
|
||||
An integral value
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
55
reference/pthreads/worker/getthreadid.xml
Normal file
55
reference/pthreads/worker/getthreadid.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.getthreadid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::getThreadId</refname>
|
||||
<refpurpose>Identification</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>long</type><methodname>Worker::getThreadId</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Will return the identity of the referenced Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A numeric value representing the identity of the referenced Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
55
reference/pthreads/worker/isjoined.xml
Normal file
55
reference/pthreads/worker/isjoined.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.isjoined" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::isJoined</refname>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Worker::isJoined</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Tell if the referenced Worker has been joined by another context
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
55
reference/pthreads/worker/iswaiting.xml
Normal file
55
reference/pthreads/worker/iswaiting.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.iswaiting" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::isWaiting</refname>
|
||||
<refpurpose>State Detection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Worker::isWaiting</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Tell if the referenced Worker is waiting for notification
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A boolean indication of state
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
55
reference/pthreads/worker/join.xml
Normal file
55
reference/pthreads/worker/join.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.join" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::join</refname>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>mixed</type><methodname>Worker::join</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Causes the calling context to wait for the referenced Worker to finish executing all of the Stackables previously stacked
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
55
reference/pthreads/worker/run.xml
Normal file
55
reference/pthreads/worker/run.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.run" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::run</refname>
|
||||
<refpurpose>Execution</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>abstract</modifier> <modifier>public</modifier> <type>mixed</type><methodname>Worker::run</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The run method of a Worker is executed before any Stackables such that the context and workers parameters may be setup in preparation for the Stackables to come
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
64
reference/pthreads/worker/stack.xml
Normal file
64
reference/pthreads/worker/stack.xml
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.stack" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::stack</refname>
|
||||
<refpurpose>Stacking</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Worker::stack</methodname>
|
||||
<methodparam><type>Stackable</type><parameter>work</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Appends the referenced Stackable to the stack of the referenced Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>work</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An object of type Stackable to be executed by the referenced Worker
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The new length of the stack
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,33 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="importedthread.isstarted" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xml:id="worker.start" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>ImportedThread::isStarted</refname>
|
||||
<refpurpose>The isStarted purpose</refpurpose>
|
||||
<refname>Worker::start</refname>
|
||||
<refpurpose>Execution</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>ImportedThread::isStarted</methodname>
|
||||
<void />
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>boolean</type><methodname>Worker::start</methodname>
|
||||
<methodparam choice="opt"><type>boolean</type><parameter>synchronized</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
A Thread does not begin executing until a call to <function>Thread::start</function>.
|
||||
A Thread cannot be started twice with a call to <function>Thread::start</function>.
|
||||
The programmer should take care to avoid potential programming errors by calling state detection methods before attempting synchronization with another Thread.
|
||||
Will start a new Thread, first executing Worker::run and then waiting for an executing Stackables
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>synchronized</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When true will cause the calling context to wait for notification from the Worker before returning from the call to Worker::start
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>A boolean indication of state.</para>
|
||||
<para>
|
||||
A boolean indication of success
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
64
reference/pthreads/worker/unstack.xml
Normal file
64
reference/pthreads/worker/unstack.xml
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<refentry xml:id="worker.unstack" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>Worker::unstack</refname>
|
||||
<refpurpose>Stacking</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>Worker::unstack</methodname>
|
||||
<methodparam choice="opt"><type>Stackable</type><parameter>work</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Removes the referenced Stackable ( or all Stackables if parameters are void ) from stack of the referenced Worker
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>work</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An object of type Stackable
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The new length of the stack
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
Loading…
Reference in a new issue