isolate event timings

19 views
Skip to first unread message

Devon Carew

unread,
Oct 19, 2015, 2:29:20 PM10/19/15
to observato...@dartlang.org
If I spawn a dart vm process with the --pause_isolates_on_start=true and --enable-vm-service flags set, then connect to the service protocol port, is there any guarantee that I'll get the IsolateRunnable event? Will the first client always be notified that there's an isolate ready to be run, or could the event be sent before my client has a chance to connect?

If there's a race condition, I assume a more reliable mechanism would be to call getVM(), and use the isolates field on the result to iterate over and start the isolates?

--
Devon Carew
Software Engineer
Google, Inc.

John Mccutchan

unread,
Oct 20, 2015, 11:03:21 AM10/20/15
to Devon Carew, observato...@dartlang.org
Hi,

You may not get the IsolateRunnable event because it could have happened before your client connected. The correct sequence (as taken from another thread):

There is a race in the system if your isolate pauses at start before you subscribe the debug stream- you will not receive an event. Starting up, you should *synchronously* (that is wait on each response) do the following:

1) getVersion.
2) streamListen(Debug)
3) streamListen(Isolate)
4) getVM()
5) getIsolate(id)


--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

Devon Carew

unread,
Oct 20, 2015, 11:21:21 AM10/20/15
to John Mccutchan, observato...@dartlang.org
On Tue, Oct 20, 2015 at 8:03 AM, John Mccutchan <johnmc...@google.com> wrote:
Hi,

You may not get the IsolateRunnable event because it could have happened before your client connected. The correct sequence (as taken from another thread):

There is a race in the system if your isolate pauses at start before you subscribe the debug stream- you will not receive an event. Starting up, you should *synchronously* (that is wait on each response) do the following:

1) getVersion.
2) streamListen(Debug)
3) streamListen(Isolate)
4) getVM()
5) getIsolate(id)

Thanks! I'll give this a shot. I assume these will all return quickly, but would prefer to parallelize where possible to speed up the connection process. I'll try it completely synchronously first.

On Mon, Oct 19, 2015 at 11:29 AM 'Devon Carew' via Dart VM Observatory Discuss <observato...@dartlang.org> wrote:
If I spawn a dart vm process with the --pause_isolates_on_start=true and --enable-vm-service flags set, then connect to the service protocol port, is there any guarantee that I'll get the IsolateRunnable event? Will the first client always be notified that there's an isolate ready to be run, or could the event be sent before my client has a chance to connect?

If there's a race condition, I assume a more reliable mechanism would be to call getVM(), and use the isolates field on the result to iterate over and start the isolates?

--
Devon Carew
Software Engineer
Google, Inc.

--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.
Reply all
Reply to author
Forward
0 new messages