Martin Kustermann
06b2967188
[vm] Disentagle PortMap/MessageHandler from port status tracking
...
The main purpose of the low-level [PortMap] is to coordinate between
ports being opened & closed and concurrent message senders. That's the
only thing it should do.
Each isolate owns [ReceivePort]s. Only the isolate mutator can create
ports, delete them or change their "keeps-isolate-alive" state. Right
now it requires going via [PortMap] (which acquires lock) and
[MessageHandler] (which acquires lock) to change the
"keeps-isolate-alive" state of a port.
We'll move information whether a dart [ReceivePort] is closed and
whether it keeps the isolate alive into the [ReceivePort] object itself.
=> Changing the "keeps-isolate-alive" state of the port no longer
requires any locks. We could even avoid the runtime call itself in a
future CL.
Isolates are kept alive if there's any open receive ports (that have not
been marked as "does not keep isolate alive"). This is a property of an
isolate not of the message handler. For native message handlers we do
have a 1<->1 correspondence between port and handler (i.e. there's no
"number of open ports" tracking needed).
=> We'll move the logic of counting open receive ports and ports that
keep the isolate alive to the [Isolate].
=> We'll also remove locking around incrementing/decrementing or
accessing the counts.
=> The [IsolateMessageHandler] will ask the [Isolate] whether there's
any open ports for determining whether to shut down.
=> For native ports, the `Dart_NewNativePort()` & `Dart_CloseNativePort()`
functions will manage the lifetime (as their name also suggests).
Overall this makes the [Isolate] responsible for creation of dart
[ReceivePort]s and tracking whether the isolate should be kept alive:
* Isolate::CreateReceivePort()
* Isolate::SetReceivePortKeepAliveState()
* Isolate::CloseReceivePort()
TEST=ci
Change-Id: I847ae357c26254d3810cc277962e05deca18a1de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317960
Reviewed-by: Alexander Aprelev <aam@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Martin Kustermann <kustermann@google.com >
2023-08-08 10:57:47 +00:00
..
2023-08-08 10:57:47 +00:00
2023-07-10 12:23:15 +00:00
2023-08-08 08:13:00 +00:00
2023-04-17 15:58:28 +00:00
2023-06-15 19:01:00 +00:00
2023-08-01 20:34:21 +00:00
2023-04-20 17:42:06 +00:00
2023-06-06 02:07:58 +00:00
2023-04-10 18:15:12 +00:00
2023-05-24 08:42:14 +00:00
2023-07-03 12:29:15 +00:00
2023-08-08 10:17:36 +00:00
2023-06-06 16:20:47 +00:00
2023-03-30 19:27:17 +00:00
2023-04-21 08:06:49 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-07-11 15:13:58 +00:00
2023-04-12 22:18:54 +00:00
2023-03-06 22:06:59 +00:00
2023-03-06 22:06:59 +00:00
2023-05-10 11:38:57 +00:00
2023-08-04 14:18:38 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-06-28 01:00:18 +00:00
2023-06-28 01:00:18 +00:00
2023-06-15 19:01:00 +00:00
2023-02-06 21:49:07 +00:00
2023-07-26 23:23:26 +00:00
2023-07-26 21:14:09 +00:00
2023-06-15 00:34:18 +00:00
2023-06-21 15:24:30 +00:00
2023-04-20 17:42:06 +00:00
2023-07-27 20:17:17 +00:00
2023-06-28 11:48:26 +00:00
2023-06-28 11:48:26 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-01-20 12:37:49 +00:00
2023-04-10 18:15:12 +00:00
2023-08-07 07:44:37 +00:00
2023-06-28 01:00:18 +00:00
2023-06-28 01:00:18 +00:00
2022-06-08 19:41:52 +00:00
2022-06-08 22:57:03 +00:00
2023-06-28 01:00:18 +00:00
2023-08-01 17:01:41 +00:00
2023-07-11 15:13:58 +00:00
2022-06-08 22:57:03 +00:00
2023-06-28 01:00:18 +00:00
2022-06-08 22:57:03 +00:00
2023-06-23 20:35:00 +00:00
2023-02-27 22:26:36 +00:00
2023-06-23 20:35:00 +00:00
2023-06-23 20:35:00 +00:00
2023-06-23 20:35:00 +00:00
2023-06-23 20:35:00 +00:00
2023-04-10 18:15:12 +00:00
2022-11-14 15:42:52 +00:00
2023-05-22 16:43:04 +00:00
2023-04-10 21:38:57 +00:00
2023-04-10 21:38:57 +00:00
2023-04-10 21:38:57 +00:00
2023-07-12 17:14:18 +00:00
2023-04-10 18:15:12 +00:00
2023-07-20 17:06:44 +00:00
2023-08-08 10:57:47 +00:00
2023-04-20 17:42:06 +00:00
2023-07-26 21:53:49 +00:00
2023-07-20 17:06:44 +00:00
2023-06-29 17:29:48 +00:00
2023-07-27 20:17:17 +00:00
2023-07-18 19:33:37 +00:00
2023-06-29 08:04:20 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-08-04 11:07:46 +00:00
2023-06-30 14:03:03 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-07-26 21:53:49 +00:00
2023-04-12 22:18:54 +00:00
2022-09-12 12:33:57 +00:00
2022-09-12 12:33:57 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-07-11 15:13:58 +00:00
2023-05-31 08:06:08 +00:00
2023-06-06 02:07:58 +00:00
2022-10-06 10:33:09 +00:00
2023-04-10 18:15:12 +00:00
2023-06-15 17:19:37 +00:00
2023-06-15 17:19:37 +00:00
2023-07-28 23:56:52 +00:00
2023-07-28 23:56:52 +00:00
2023-08-08 08:13:00 +00:00
2023-07-26 23:23:26 +00:00
2023-06-28 09:21:11 +00:00
2023-04-26 22:18:51 +00:00
2023-07-27 20:17:17 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-08-01 16:11:40 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-03-29 18:11:49 +00:00
2023-07-26 21:53:49 +00:00
2023-04-18 19:39:05 +00:00
2023-02-06 22:19:55 +00:00
2023-04-10 18:15:12 +00:00
2023-06-23 20:35:00 +00:00
2023-06-23 20:35:00 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-06-27 19:42:15 +00:00
2022-12-01 10:15:58 +00:00
2023-06-06 02:07:58 +00:00
2023-05-31 08:06:08 +00:00
2023-07-11 15:13:58 +00:00
2023-04-12 22:18:54 +00:00
2022-05-11 19:52:45 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-13 19:29:47 +00:00
2023-04-12 22:18:54 +00:00
2023-03-06 22:06:59 +00:00
2023-04-12 22:18:54 +00:00
2022-05-11 19:52:45 +00:00
2022-05-11 19:52:45 +00:00
2023-07-26 21:14:09 +00:00
2023-08-01 19:36:50 +00:00
2023-05-10 19:08:23 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-06-09 17:57:12 +00:00
2023-06-09 17:57:12 +00:00
2023-04-17 15:58:28 +00:00
2023-04-17 15:58:28 +00:00
2023-04-17 15:58:28 +00:00
2023-07-14 10:15:06 +00:00
2023-08-01 09:04:38 +00:00
2023-07-28 10:01:53 +00:00
2023-07-28 10:01:53 +00:00
2023-08-04 13:40:32 +00:00
2023-08-04 13:40:32 +00:00
2022-11-11 01:59:28 +00:00
2023-07-14 10:15:06 +00:00
2023-07-14 10:15:06 +00:00
2023-08-08 10:17:36 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2022-05-11 19:31:04 +00:00
2023-04-20 17:42:06 +00:00
2023-04-10 18:15:12 +00:00
2023-06-29 08:04:20 +00:00
2023-06-29 08:04:20 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-07-11 10:15:58 +00:00
2022-08-19 18:10:15 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-07-26 21:53:49 +00:00
2023-03-29 19:58:33 +00:00
2023-04-10 18:15:12 +00:00
2023-03-29 19:58:33 +00:00
2023-04-10 18:15:12 +00:00
2023-08-08 10:57:47 +00:00
2023-07-26 21:53:49 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-07-26 21:53:49 +00:00
2023-02-23 03:11:08 +00:00
2023-04-10 18:15:12 +00:00
2023-05-10 16:12:28 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-07-26 21:14:09 +00:00
2023-08-01 20:34:21 +00:00
2023-06-27 07:18:50 +00:00
2023-06-30 14:03:03 +00:00
2023-07-24 16:55:47 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-06-12 15:26:29 +00:00
2023-06-12 15:26:29 +00:00
2023-06-14 20:36:48 +00:00
2023-06-12 15:26:29 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2022-03-10 23:48:05 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-07-10 20:33:33 +00:00
2023-07-10 20:33:33 +00:00
2023-06-12 15:26:29 +00:00
2023-06-12 15:26:29 +00:00
2023-06-30 14:03:03 +00:00
2023-08-04 11:07:46 +00:00
2022-06-02 23:39:45 +00:00
2022-06-02 23:39:45 +00:00
2023-05-15 20:51:38 +00:00
2022-09-27 21:34:05 +00:00
2023-04-12 22:18:54 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-08-08 10:57:47 +00:00
2023-04-10 18:15:12 +00:00
2023-05-15 20:51:38 +00:00
2023-05-03 19:17:11 +00:00
2023-04-12 22:18:54 +00:00
2023-04-20 17:42:06 +00:00
2023-04-19 09:36:41 +00:00
2023-04-19 08:47:31 +00:00
2023-04-10 18:15:12 +00:00
2023-08-01 15:50:11 +00:00
2023-08-08 10:57:47 +00:00
2022-12-01 14:38:44 +00:00
2023-04-28 19:29:36 +00:00
2023-08-08 10:57:47 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-07-06 21:10:28 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2022-12-29 10:18:02 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2023-06-28 01:00:18 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2023-07-11 22:31:57 +00:00
2023-06-28 01:00:18 +00:00
2023-04-10 18:15:12 +00:00
2023-08-04 11:07:46 +00:00
2023-08-04 11:07:46 +00:00
2023-06-09 17:57:12 +00:00
2023-06-29 08:04:20 +00:00
2023-04-10 18:15:12 +00:00
2023-08-08 08:13:00 +00:00
2023-08-08 10:57:47 +00:00
2023-08-01 20:34:21 +00:00
2023-06-23 17:01:58 +00:00
2023-06-23 17:01:58 +00:00
2023-01-06 07:48:22 +00:00
2023-07-21 19:06:43 +00:00
2023-07-21 19:06:43 +00:00
2023-07-21 19:06:43 +00:00
2023-07-21 19:06:43 +00:00
2023-07-11 15:13:58 +00:00
2023-04-12 22:18:54 +00:00
2023-07-11 15:13:58 +00:00
2023-04-12 22:18:54 +00:00
2022-07-29 18:11:01 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-07-17 15:01:21 +00:00
2023-07-13 08:17:38 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-28 23:25:43 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-06-30 14:03:03 +00:00
2023-06-30 14:03:03 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2023-07-03 10:39:53 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2023-06-06 02:07:58 +00:00
2023-07-03 10:39:53 +00:00
2023-04-19 08:47:31 +00:00
2023-07-26 23:23:26 +00:00
2023-06-27 19:47:04 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-02-21 19:07:57 +00:00
2023-04-10 18:15:12 +00:00
2023-05-11 21:41:01 +00:00
2023-04-12 22:18:54 +00:00
2023-04-10 18:15:12 +00:00
2023-03-06 22:06:59 +00:00
2023-01-09 15:48:57 +00:00
2023-04-26 22:18:51 +00:00
2023-07-27 20:17:17 +00:00
2023-05-10 19:08:23 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-20 17:42:06 +00:00
2023-07-12 15:46:27 +00:00
2023-06-29 17:29:48 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-07-10 20:33:33 +00:00
2023-07-10 20:33:33 +00:00
2023-07-10 20:33:33 +00:00
2023-02-20 14:57:57 +00:00
2022-08-03 10:32:46 +00:00
2023-04-12 22:18:54 +00:00
2023-06-24 12:56:12 +00:00
2023-07-06 08:16:47 +00:00
2023-04-17 16:26:35 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-04-12 22:18:54 +00:00
2023-07-28 10:01:53 +00:00
2023-06-23 20:35:00 +00:00
2023-05-11 03:14:27 +00:00
2023-05-11 03:14:27 +00:00
2023-05-11 03:14:27 +00:00
2023-04-10 18:15:12 +00:00
2023-04-10 18:15:12 +00:00
2023-04-12 22:18:54 +00:00
2022-08-05 11:53:37 +00:00
2023-06-23 20:35:00 +00:00
2023-06-23 20:35:00 +00:00
2023-06-20 19:28:18 +00:00
2023-06-21 11:39:50 +00:00
2023-06-06 02:07:58 +00:00
2023-06-21 11:39:50 +00:00
2023-06-28 01:00:18 +00:00
2023-06-20 19:28:18 +00:00
2022-09-10 15:12:35 +00:00
2023-04-21 22:41:28 +00:00
2023-06-06 02:07:58 +00:00
2023-06-07 19:01:51 +00:00
2023-06-16 11:22:38 +00:00
2023-06-16 11:22:38 +00:00