OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Concurrent programming using _isolates_: | 6 * Concurrent programming using _isolates_: |
7 * independent workers that are similar to threads | 7 * independent workers that are similar to threads |
8 * but don't share memory, | 8 * but don't share memory, |
9 * communicating only via messages. | 9 * communicating only via messages. |
10 */ | 10 */ |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 * | 113 * |
114 * If all the available capabilities are included, | 114 * If all the available capabilities are included, |
115 * there is no reason to create a new object, | 115 * there is no reason to create a new object, |
116 * since the behavior is defined entirely | 116 * since the behavior is defined entirely |
117 * by the control port and capabilities. | 117 * by the control port and capabilities. |
118 */ | 118 */ |
119 Isolate(this.controlPort, {this.pauseCapability, | 119 Isolate(this.controlPort, {this.pauseCapability, |
120 this.terminateCapability}); | 120 this.terminateCapability}); |
121 | 121 |
122 /** | 122 /** |
123 * Return the current isolate. | |
124 * | |
125 * This isolate can be sent to other isolates created using [Isolate.spawn] | |
floitsch
2014/12/02 12:13:57
a: we should agree on terminology for these kind o
Lasse Reichstein Nielsen
2014/12/03 15:34:30
Removed. Can't think of a short example that isn't
| |
126 * or its control port and capablities can be sent to isolates created | |
127 * using [Isolate.spawnUri]. | |
128 * It gives access to the capabilities needed to inspect, pause or kill | |
floitsch
2014/12/02 12:13:56
New line before?
Lasse Reichstein Nielsen
2014/12/03 15:34:30
Removed the previous paragraph.
| |
129 * the isolate, and allows passing these capabilities to others. | |
130 */ | |
131 external static Isolate get current; | |
132 | |
133 /** | |
123 * Creates and spawns an isolate that shares the same code as the current | 134 * Creates and spawns an isolate that shares the same code as the current |
124 * isolate. | 135 * isolate. |
125 * | 136 * |
126 * The argument [entryPoint] specifies the entry point of the spawned | 137 * The argument [entryPoint] specifies the entry point of the spawned |
127 * isolate. It must be a top-level function or a static method that | 138 * isolate. It must be a top-level function or a static method that |
128 * takes one argument - that is, one-parameter functions that can be | 139 * takes one argument - that is, one-parameter functions that can be |
129 * compile-time constant function values. | 140 * compile-time constant function values. |
130 * It is not allowed to pass the value of function expressions or an instance | 141 * It is not allowed to pass the value of function expressions or an instance |
131 * method extracted from an object. | 142 * method extracted from an object. |
132 * | 143 * |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
600 : _description = description, | 611 : _description = description, |
601 stackTrace = new _RemoteStackTrace(stackDescription); | 612 stackTrace = new _RemoteStackTrace(stackDescription); |
602 String toString() => _description; | 613 String toString() => _description; |
603 } | 614 } |
604 | 615 |
605 class _RemoteStackTrace implements StackTrace { | 616 class _RemoteStackTrace implements StackTrace { |
606 String _trace; | 617 String _trace; |
607 _RemoteStackTrace(this._trace); | 618 _RemoteStackTrace(this._trace); |
608 String toString() => _trace; | 619 String toString() => _trace; |
609 } | 620 } |
OLD | NEW |