-
Notifications
You must be signed in to change notification settings - Fork 873
Expand file tree
/
Copy pathrun.xml
More file actions
180 lines (171 loc) · 5.84 KB
/
Copy pathrun.xml
File metadata and controls
180 lines (171 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="parallel-runtime.run">
<refnamediv>
<refname>parallel\Runtime::run</refname>
<refpurpose>Execution</refpurpose>
</refnamediv>
<refsect1 role="description" audience="execute">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type class="union"><type>Future</type><type>null</type></type><methodname>parallel\Runtime::run</methodname>
<methodparam><type>Closure</type><parameter>task</parameter></methodparam>
</methodsynopsis>
<simpara>
Shall schedule <parameter>task</parameter> for execution in parallel.
</simpara>
<methodsynopsis>
<modifier>public</modifier> <type class="union"><type>Future</type><type>null</type></type><methodname>parallel\Runtime::run</methodname>
<methodparam><type>Closure</type><parameter>task</parameter></methodparam>
<methodparam><type>array</type><parameter>argv</parameter></methodparam>
</methodsynopsis>
<simpara>
Shall schedule <parameter>task</parameter> for execution in parallel, passing <parameter>argv</parameter> at execution time.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>task</parameter></term>
<listitem>
<simpara>
A <classname>Closure</classname> with specific characteristics.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argv</parameter></term>
<listitem>
<simpara>
An <type>array</type> of arguments with specific characteristics to be passed to <parameter>task</parameter> at execution time.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="closure-characteristics">
<title>Task Characteristics</title>
<para>
Closures scheduled for parallel execution must not:
<simplelist>
<member>accept or return by reference</member>
<member>accept or return internal objects (see notes)</member>
<member>execute a limited set of instructions</member>
</simplelist>
</para>
<para>
Instructions prohibited in Closures intended for parallel execution are:
<simplelist>
<member>yield</member>
<member>use by-reference</member>
<member>declare class</member>
<member>declare named function</member>
</simplelist>
</para>
<note>
<simpara>
Nested closures may yield or use by-reference, but must not contain class or named function declarations.
</simpara>
</note>
<note>
<simpara>
No instructions are prohibited in the files which the task may include.
</simpara>
</note>
</refsect1>
<refsect1 role="argv-characteristics">
<title>Arguments Characteristics</title>
<para>
Arguments must not:
<simplelist>
<member>contain references</member>
<member>contain resources</member>
<member>contain internal objects (see notes)</member>
</simplelist>
<note>
<simpara>
In the case of file stream resources, the resource will be cast to the file descriptor and passed as <type>int</type> where possible, this is unsupported on Windows.
</simpara>
</note>
</para>
</refsect1>
<refsect1 role="object-characteristics">
<title>Internal Objects Notes</title>
<simpara>
Internal objects generally use a custom structure which cannot be copied by value safely, PHP currently lacks the mechanics to do this (without serialization)
and so only objects that do not use a custom structure may be shared.
</simpara>
<simpara>
Some internal objects do not use a custom structure, for example <classname>parallel\Events\Event</classname> and so may be shared.
</simpara>
<simpara>
Closures are a special kind of internal object and support being copied by value, and so may be shared.
</simpara>
<simpara>
Channels are central to writing parallel code and support concurrent access and execution by necessity, and so may be shared.
</simpara>
<warning>
<simpara>
A user class that extends an internal class may use a custom structure as defined by the internal class, in which case they cannot be copied by value safely,
and so may not be shared.
</simpara>
</warning>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<warning>
<simpara>
The return <type>parallel\Future</type> must not be ignored when the task contains a return or throw statement.
</simpara>
</warning>
</refsect1>
<refsect1 role="exceptions">
<title>Exceptions</title>
<warning>
<simpara>
Shall throw <type>parallel\Runtime\Error\Closed</type> if <type>parallel\Runtime</type> was closed.
</simpara>
</warning>
<warning>
<simpara>
Shall throw <type>parallel\Runtime\Error\IllegalFunction</type> if <parameter>task</parameter> is a closure created from an internal function.
</simpara>
</warning>
<warning>
<simpara>
Shall throw <type>parallel\Runtime\Error\IllegalInstruction</type> if <parameter>task</parameter> contains illegal instructions.
</simpara>
</warning>
<warning>
<simpara>
Shall throw <type>parallel\Runtime\Error\IllegalParameter</type> if <parameter>task</parameter> accepts or <parameter>argv</parameter> contains illegal variables.
</simpara>
</warning>
<warning>
<simpara>
Shall throw <type>parallel\Runtime\Error\IllegalReturn</type> if <parameter>task</parameter> returns illegally.
</simpara>
</warning>
</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
-->