| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart core library. | 5 // Dart core library. |
| 6 // TODO(sigmund): move to dart:isolate |
| 6 | 7 |
| 7 /** | 8 /** |
| 8 * [SendPort]s are created from [ReceivePort]s. Any message sent through | 9 * [SendPort]s are created from [ReceivePort]s. Any message sent through |
| 9 * a [SendPort] is delivered to its respective [ReceivePort]. There might be | 10 * a [SendPort] is delivered to its respective [ReceivePort]. There might be |
| 10 * many [SendPort]s for the same [ReceivePort]. | 11 * many [SendPort]s for the same [ReceivePort]. |
| 11 * | 12 * |
| 12 * [SendPort]s can be transmitted to other isolates. | 13 * [SendPort]s can be transmitted to other isolates. |
| 13 */ | 14 */ |
| 14 interface SendPort extends Hashable { | 15 interface SendPort extends Hashable { |
| 15 | 16 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 * and invokes the instance method [main]. | 104 * and invokes the instance method [main]. |
| 104 * | 105 * |
| 105 * The new instance is created by invoking the default constructor of the | 106 * The new instance is created by invoking the default constructor of the |
| 106 * class that served as template for spawning the new isolate. This means, that | 107 * class that served as template for spawning the new isolate. This means, that |
| 107 * sub-classes must have a default constructor (i.e. no-argument constructor). | 108 * sub-classes must have a default constructor (i.e. no-argument constructor). |
| 108 * | 109 * |
| 109 * Isolates may be "heavy" or "light". Heavy isolates live in their own thread, | 110 * Isolates may be "heavy" or "light". Heavy isolates live in their own thread, |
| 110 * whereas "light" isolates live in the same thread as the isolate which spawned | 111 * whereas "light" isolates live in the same thread as the isolate which spawned |
| 111 * them. | 112 * them. |
| 112 */ | 113 */ |
| 114 // TODO(sigmund): delete once we implement the new isolates in the vm |
| 113 class Isolate { | 115 class Isolate { |
| 114 | 116 |
| 115 /** | 117 /** |
| 116 * Redirects to [Isolate.light]. | 118 * Redirects to [Isolate.light]. |
| 117 */ | 119 */ |
| 118 Isolate() : this.light(); | 120 Isolate() : this.light(); |
| 119 | 121 |
| 120 /** | 122 /** |
| 121 * Creates a new isolate-template for a light isolate. | 123 * Creates a new isolate-template for a light isolate. |
| 122 */ | 124 */ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 /** | 173 /** |
| 172 * When isolates are created, an instance of the template's class is | 174 * When isolates are created, an instance of the template's class is |
| 173 * instantiated in the new isolate. After the [port] has been set up, this | 175 * instantiated in the new isolate. After the [port] has been set up, this |
| 174 * [main] method is invoked on the instance. | 176 * [main] method is invoked on the instance. |
| 175 */ | 177 */ |
| 176 abstract void main(); | 178 abstract void main(); |
| 177 | 179 |
| 178 final bool _isLight; | 180 final bool _isLight; |
| 179 ReceivePort _port; | 181 ReceivePort _port; |
| 180 } | 182 } |
| OLD | NEW |