php-doc-en/reference/parallel/parallel.runtime.xml

105 lines
3.7 KiB
XML
Raw Permalink Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.parallel-runtime" 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 parallel\Runtime class</title>
<titleabbrev>parallel\Runtime</titleabbrev>
<partintro>
<section>
<title>Runtime Objects</title>
<para>
Each runtime represents a single PHP thread, the thread is created (and bootstrapped) upon construction.
The thread then waits for tasks to be scheduled: Scheduled tasks will be executed FIFO and then the thread will resume waiting until
more tasks are scheduled, or it's closed, killed, or destroyed by the normal scoping rules of PHP objects.
</para>
<warning>
<para>
When a runtime is destroyed by the normal scoping rules of PHP objects, it will first execute all of the tasks that were scheduled,
and block while doing so.
</para>
</warning>
</section>
<section>
<title>Runtime Bootstrapping</title>
<para>
When a new runtime is created, it does not share code with the thread (or process) that created it. This means it doesn't have the same
classes and functions loaded, nor the same autoloader set. In some cases, a very lightweight runtime is desirable because the tasks that
will be scheduled do not need access to the code in the parent thread. In those cases where the tasks do need to access the same code, it
is enough to set an autoloader as the bootstrap.
</para>
<note>
<para>
preloading may be used in conjunction with parallel, in this case preloaded code is available without bootstrapping
</para>
</note>
</section>
<section xml:id="parallel-runtime.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>parallel\Runtime</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>final</modifier>
<classname>parallel\Runtime</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Create</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.parallel-runtime')/db:refentry/db:refsect1[@audience='create']/descendant::db:constructorsynopsis[not(@role='procedural')])">
<xi:fallback />
</xi:include>
<classsynopsisinfo role="comment">Execute</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.parallel-runtime')/db:refentry/db:refsect1[@audience='execute']/descendant::db:methodsynopsis[not(@role='procedural')])">
<xi:fallback />
</xi:include>
<classsynopsisinfo role="comment">Join</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.parallel-runtime')/db:refentry/db:refsect1[@audience='join']/descendant::db:methodsynopsis[not(@role='procedural')])">
<xi:fallback />
</xi:include>
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.parallel.parallel.runtime.construct;
&reference.parallel.parallel.runtime.run;
&reference.parallel.parallel.runtime.close;
&reference.parallel.parallel.runtime.kill;
</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
-->