parallel\Runtime::run
(0.8.0)
parallel\Runtime::run — Parallel Execution
说明
Shall schedule task
for execution in parallel.
Shall schedule task
for execution in parallel, passing argv
at execution time.
参数
Task Characteristics
Closures scheduled for parallel execution must not:
- accept or return by reference
- accept or return objects
- execute a limited set of instructions
Instructions prohibited in Closures intended for parallel execution are:
- declare (anonymous) class
- use (by-reference)
- yield
Note:
Only declare class instructions are prohibited in closures or functions that are nested in tasks, no instructions are prohibited in the files which the task may include.
Arguments Characteristics
Arguments must not:
- contain references
- contain objects
- contain resources
Note:
In the case of file stream resources, the resource will be cast to the file descriptor and passed as int where possible, this is unsupported on Windows.
返回值
The return \parallel\Future must not be ignored when the task contains a return or throw statement.
Exceptions
Shall throw \parallel\Runtime\Error\Closed if \parallel\Runtime was closed.
Shall throw \parallel\Runtime\Error\IllegalFunction if task
is a closure created from an internal function.
Shall throw \parallel\Runtime\Error\IllegalInstruction if task
contains illegal instructions.
Shall throw \parallel\Runtime\Error\IllegalParameter if task
accepts or argv
contains illegal variables.
Shall throw \parallel\Runtime\Error\IllegalReturn if task
returns illegally.