Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 9317068: isolate lib: small refactor to distinguish protocols at the port level (Closed)

Created:
8 years, 10 months ago by Siggi Cherem (dart-lang)
Modified:
8 years, 10 months ago
Reviewers:
eub, mattsh
CC:
reviews_dartlang.org, kasperl
Visibility:
Public.

Description

isolate lib: small refactor to distinguish protocols at the port level Committed: https://code.google.com/p/dart/source/detail?r=4148

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 10

Patch Set 4 : '' #

Total comments: 7

Patch Set 5 : '' #

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -85 lines) Patch
M corelib/src/implementation/promise_implementation.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M frog/lib/isolate.dart View 1 2 3 4 5 6 chunks +108 lines, -70 lines 0 comments Download
M frog/lib/isolate_serialization.dart View 1 2 3 4 5 chunks +29 lines, -11 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Siggi Cherem (dart-lang)
8 years, 10 months ago (2012-02-03 02:07:10 UTC) #1
Siggi Cherem (dart-lang)
8 years, 10 months ago (2012-02-03 18:47:22 UTC) #2
eub
https://chromiumcodereview.appspot.com/9317068/diff/5001/frog/lib/isolate.dart File frog/lib/isolate.dart (right): https://chromiumcodereview.appspot.com/9317068/diff/5001/frog/lib/isolate.dart#newcode331 frog/lib/isolate.dart:331: final int _isolateId; id of destination? https://chromiumcodereview.appspot.com/9317068/diff/5001/frog/lib/isolate.dart#newcode384 frog/lib/isolate.dart:384: final ...
8 years, 10 months ago (2012-02-09 01:13:42 UTC) #3
Siggi Cherem (dart-lang)
https://chromiumcodereview.appspot.com/9317068/diff/5001/frog/lib/isolate.dart File frog/lib/isolate.dart (right): https://chromiumcodereview.appspot.com/9317068/diff/5001/frog/lib/isolate.dart#newcode331 frog/lib/isolate.dart:331: final int _isolateId; On 2012/02/09 01:13:42, eub wrote: > ...
8 years, 10 months ago (2012-02-10 00:16:41 UTC) #4
eub
LGTM, couple of small suggestions. https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart File frog/lib/isolate.dart (right): https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart#newcode397 frog/lib/isolate.dart:397: if (shouldSerialize) { I ...
8 years, 10 months ago (2012-02-10 21:20:57 UTC) #5
Siggi Cherem (dart-lang)
Thanks Eli! https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart File frog/lib/isolate.dart (right): https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart#newcode397 frog/lib/isolate.dart:397: if (shouldSerialize) { On 2012/02/10 21:20:57, eub ...
8 years, 10 months ago (2012-02-10 22:09:21 UTC) #6
eub
https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart File frog/lib/isolate.dart (right): https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart#newcode397 frog/lib/isolate.dart:397: if (shouldSerialize) { On 2012/02/10 22:09:22, sigmund wrote: > ...
8 years, 10 months ago (2012-02-10 22:11:49 UTC) #7
Siggi Cherem (dart-lang)
8 years, 10 months ago (2012-02-10 22:14:14 UTC) #8
On 2012/02/10 22:11:49, eub wrote:
>
https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.dart
frog/lib/isolate.dart (right):
> 
>
https://chromiumcodereview.appspot.com/9317068/diff/10001/frog/lib/isolate.da...
> frog/lib/isolate.dart:397: if (shouldSerialize) {
> On 2012/02/10 22:09:22, sigmund wrote:
> > On 2012/02/10 21:20:57, eub wrote:
> > > I liked your previous version with the serialize-deserialize in one shot
> > instead
> > > of two if() checks.
> > 
> > Me too - when I did some testing, I realized that it didn't provide me the
> right
> > semantics. If I forced isolates to run in the same place, this example was
> > printing "after" instead of "before":
> > 
> > other(port) => port.receive((msg, _) => print(msg[0]));
> > 
> > main() {
> >   sample = ["before"];
> >   (new Isolate.fromCode(other)).sendPort.send(sample);
> >   sample[0] = "after";
> > }
> > 
> > Basically because the serialize-deserialize was applied after sample was
> > modified.
> 
> Can we come up with a simple comment explaining to my future self why I
> shouldn't change the code to the other version? :)

will do - I'll add the test too :)

Powered by Google App Engine
This is Rietveld 408576698