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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
478 * | 478 * |
479 * The content of [message] can be: primitive values (null, num, bool, double, | 479 * The content of [message] can be: primitive values (null, num, bool, double, |
480 * String), instances of [SendPort], and lists and maps whose elements are any | 480 * String), instances of [SendPort], and lists and maps whose elements are any |
481 * of these. List and maps are also allowed to be cyclic. | 481 * of these. List and maps are also allowed to be cyclic. |
482 * | 482 * |
483 * In the special circumstances when two isolates share the same code and are | 483 * In the special circumstances when two isolates share the same code and are |
484 * running in the same process (e.g. isolates created via [Isolate.spawn]), it | 484 * running in the same process (e.g. isolates created via [Isolate.spawn]), it |
485 * is also possible to send object instances (which would be copied in the | 485 * is also possible to send object instances (which would be copied in the |
486 * process). This is currently only supported by the dartvm. For now, the | 486 * process). This is currently only supported by the dartvm. For now, the |
487 * dart2js compiler only supports the restricted messages described above. | 487 * dart2js compiler only supports the restricted messages described above. |
488 * | |
489 * The send is immediate--it is not necessary to yield control to the event | |
490 * loop, provided that the receiver is running in a parallel isolate. | |
Lasse Reichstein Nielsen
2015/08/31 19:45:20
I don't think we use the term "parallel isolate" a
Paul Berry
2015/08/31 19:48:53
Works for me. PTAL.
| |
488 */ | 491 */ |
489 void send(var message); | 492 void send(var message); |
490 | 493 |
491 /** | 494 /** |
492 * Tests whether [other] is a [SendPort] pointing to the same | 495 * Tests whether [other] is a [SendPort] pointing to the same |
493 * [ReceivePort] as this one. | 496 * [ReceivePort] as this one. |
494 */ | 497 */ |
495 bool operator==(var other); | 498 bool operator==(var other); |
496 | 499 |
497 /** | 500 /** |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 * as the original error, but has no other features of the original error. | 635 * as the original error, but has no other features of the original error. |
633 */ | 636 */ |
634 class RemoteError implements Error { | 637 class RemoteError implements Error { |
635 final String _description; | 638 final String _description; |
636 final StackTrace stackTrace; | 639 final StackTrace stackTrace; |
637 RemoteError(String description, String stackDescription) | 640 RemoteError(String description, String stackDescription) |
638 : _description = description, | 641 : _description = description, |
639 stackTrace = new StackTrace.fromString(stackDescription); | 642 stackTrace = new StackTrace.fromString(stackDescription); |
640 String toString() => _description; | 643 String toString() => _description; |
641 } | 644 } |
OLD | NEW |