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

Issue 13452007: Add new Dart API call Dart_MakeIsolateRunnable(). This would allow an (Closed)

Created:
7 years, 8 months ago by siva
Modified:
7 years, 8 months ago
Reviewers:
Anton Muhin, Ivan Posva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add new Dart API call Dart_MakeIsolateRunnable(). This would allow an embedder to indicate when an Isolate is runnable and would allow for asynchronous loading of scripts when an isolate is spawned. The standalone embedder which does synchronous loading of scripts calls Dart_MakeIsolateRunnable immediately after it finished loading the scripts synchronously.

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Patch Set 5 : #

Total comments: 8

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -249 lines) Patch
M runtime/bin/main.cc View 1 2 3 4 5 6 4 chunks +29 lines, -16 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 4 5 6 5 chunks +34 lines, -18 lines 6 comments Download
M runtime/lib/isolate.cc View 1 2 3 4 5 7 chunks +16 lines, -209 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 5 6 3 chunks +10 lines, -6 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 6 chunks +36 lines, -0 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 5 3 chunks +194 lines, -0 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
siva
7 years, 8 months ago (2013-04-05 02:06:46 UTC) #1
siva
7 years, 8 months ago (2013-04-05 02:07:15 UTC) #2
Ivan Posva
-Ivan https://codereview.chromium.org/13452007/diff/3002/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://codereview.chromium.org/13452007/diff/3002/runtime/include/dart_api.h#newcode836 runtime/include/dart_api.h:836: * isolate is complete and the isolate can ...
7 years, 8 months ago (2013-04-05 04:18:04 UTC) #3
siva
Changed API to include an isolate parameter and added check to ensure there is no ...
7 years, 8 months ago (2013-04-05 07:04:05 UTC) #4
Ivan Posva
https://chromiumcodereview.appspot.com/13452007/diff/21001/runtime/bin/main.cc File runtime/bin/main.cc (right): https://chromiumcodereview.appspot.com/13452007/diff/21001/runtime/bin/main.cc#newcode483 runtime/bin/main.cc:483: Dart_ExitIsolate(); If this method was changed to return the ...
7 years, 8 months ago (2013-04-05 15:51:59 UTC) #5
siva
Anton, this CL now has an API change. Please review it. It would require some ...
7 years, 8 months ago (2013-04-05 17:43:29 UTC) #6
siva
7 years, 8 months ago (2013-04-05 17:49:46 UTC) #7
siva
7 years, 8 months ago (2013-04-05 17:52:19 UTC) #8
Anton Muhin
https://chromiumcodereview.appspot.com/13452007/diff/46001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://chromiumcodereview.appspot.com/13452007/diff/46001/runtime/include/dart_api.h#newcode597 runtime/include/dart_api.h:597: * \return The embedder returns false if the creation ...
7 years, 8 months ago (2013-04-08 15:20:17 UTC) #9
Ivan Posva
Created https://codereview.chromium.org/13813018 to land this change in sync with Anton and addressed review comment there. ...
7 years, 8 months ago (2013-04-09 17:38:55 UTC) #10
Anton Muhin
https://codereview.chromium.org/13452007/diff/46001/runtime/include/dart_api.h File runtime/include/dart_api.h (right): https://codereview.chromium.org/13452007/diff/46001/runtime/include/dart_api.h#newcode843 runtime/include/dart_api.h:843: DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate); Sorry for not being clear, ...
7 years, 8 months ago (2013-04-09 17:45:12 UTC) #11
Ivan Posva
7 years, 8 months ago (2013-04-09 18:19:47 UTC) #12
The linked changelist https://codereview.chromium.org/13813018 was committed as:
https://code.google.com/p/dart/source/detail?r=21160

-Ivan

https://codereview.chromium.org/13452007/diff/46001/runtime/include/dart_api.h
File runtime/include/dart_api.h (right):

https://codereview.chromium.org/13452007/diff/46001/runtime/include/dart_api....
runtime/include/dart_api.h:843: DART_EXPORT bool
Dart_IsolateMakeRunnable(Dart_Isolate isolate);
On 2013/04/09 17:45:12, Anton Muhin wrote:
> Sorry for not being clear, I was curious if there are any restrictions for the
> thread on which I can invoke this method?
> 
> Must it be a thread on which the isolate callback has been invoked on any
other
> thread?

The Dart_IsolateMakeRunnable should be callable on any thread. As the
documentation says, you do not have to enter any isolate to make that call.

> Overall, are there any restrictions on the thread from which I can load the
> source of the isolate?

To load sources into an isolate you need to enter that isolate on the thread
calling Dart_LoadLibrary and friends. This is only possible once you have exited
the newly created isolate from within the callback.

> On 2013/04/09 17:38:55, Ivan Posva wrote:
> > On 2013/04/08 15:20:17, Anton Muhin wrote:
> > > any restriction on thread affinity? 
> > 
> > Not sure I understand the question, but this will tell the VM that the VM
> > internal thread pool is allowed to pickup the isolate and start dispatching
> > events. If this call is made from within the Dart_IsolateCreateCallback,
then
> > dispatching starts once the callback returns.
>

Powered by Google App Engine
This is Rietveld 408576698