Vyacheslav Egorov
e2efffa005
[vm] Simplify implementation of native ports
...
This reland commit 5a32d8bc7c with a fix
for thread leak (Issue #56717 ): when `ThreadPool` is shutting down
asynchronously the last worker should detach itself to prevent
leaking associated low-level data structures, because no thread will
join it.
A hang in service isolate shutdown (caused by an existing bug) was fixed by commit 157a0dc7f9 .
This CL turns native ports into a thin abstraction over underlying
thread pool instead of building them as full fledged MessageHandler.
This allows to easily implement a variation of native ports which can
handle messages concurrently with the given degree of concurrency.
This type of port can be used to greatly simplify implementation of
IOService - which previously had to do its own concurrency management
on top of "single threaded" native ports. This capability is exposed
as `Dart_NewConcurrentNativePort` API.
The new implementation is in general much cleaner then the old one
with one exception: `Dart_CloseNativePort` API has unfortunate design
where underlying message handler is destroyed asynchronously and
`Dart_CloseNativePort` returns immediately without waiting for pending
tasks to complete. Implementing this on top of `ThreadPool` requires
some changes to thread pool implementation.
Issue https://github.com/dart-lang/sdk/issues/55844
Closes https://github.com/dart-lang/sdk/issues/56717
TEST=ci
Change-Id: Ic68bfb60757685afd75c80a70cdec66cc13c149b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385000
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Slava Egorov <vegorov@google.com >
2024-09-12 15:16:12 +00:00
..
2024-08-19 06:52:34 +00:00
2023-03-06 20:52:03 +00:00
2022-10-10 21:04:18 +00:00
2023-07-04 08:28:14 +00:00
2024-07-29 21:51:27 +00:00
2024-09-12 01:15:27 +00:00
2023-10-06 16:11:36 +00:00
2023-10-02 16:57:44 +00:00
2024-03-26 11:12:38 +00:00
2024-05-02 07:18:20 +00:00
2024-05-02 07:18:20 +00:00
2023-05-24 08:42:14 +00:00
2023-07-03 12:29:15 +00:00
2024-03-15 17:21:30 +00:00
2023-09-11 07:56:47 +00:00
2023-01-26 22:56:48 +00:00
2023-06-29 17:27:48 +00:00
2023-01-26 22:56:48 +00:00
2023-01-26 22:56:48 +00:00
2022-08-23 13:53:42 +00:00
2024-04-12 19:42:15 +00:00
2022-06-15 15:35:38 +00:00
2023-06-20 17:17:34 +00:00
2023-06-20 17:17:34 +00:00
2023-03-06 19:04:55 +00:00
2021-11-24 13:03:52 +00:00
2024-03-26 11:12:38 +00:00
2023-06-22 11:11:11 +00:00
2023-03-28 21:15:58 +00:00
2023-03-01 18:15:09 +00:00
2023-03-01 18:15:09 +00:00
2023-10-27 07:55:47 +00:00
2024-03-18 20:56:24 +00:00
2024-03-18 20:56:24 +00:00
2023-06-30 14:03:03 +00:00
2024-03-26 11:12:38 +00:00
2021-05-06 22:36:04 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2023-06-29 17:27:48 +00:00
2023-06-29 17:27:48 +00:00
2024-03-26 11:12:38 +00:00
2024-03-15 17:21:30 +00:00
2021-05-26 06:04:01 +00:00
2022-06-15 11:08:28 +00:00
2022-12-08 23:29:14 +00:00
2024-08-02 14:09:34 +00:00
2024-03-26 11:12:38 +00:00
2024-02-16 16:39:09 +00:00
2022-06-17 17:20:09 +00:00
2022-06-17 17:20:09 +00:00
2023-01-24 18:00:25 +00:00
2021-09-02 14:14:35 +00:00
2024-04-29 14:18:01 +00:00
2024-09-12 15:16:12 +00:00
2024-09-09 15:03:09 +00:00
2021-05-18 07:19:53 +00:00
2023-01-24 18:00:25 +00:00
2024-04-29 14:18:01 +00:00
2023-08-11 08:18:30 +00:00
2022-03-04 10:00:41 +00:00
2022-03-30 15:35:22 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2022-08-10 19:27:38 +00:00
2023-02-28 20:26:58 +00:00
2024-03-15 17:21:30 +00:00
2024-04-22 17:29:49 +00:00
2024-06-06 10:56:12 +00:00
2022-01-26 23:44:31 +00:00
2022-10-20 20:31:20 +00:00
2021-08-16 22:52:21 +00:00
2023-04-03 12:25:55 +00:00
2023-04-03 12:25:55 +00:00
2024-01-08 13:07:16 +00:00
2023-04-03 12:25:55 +00:00
2022-10-03 14:58:58 +00:00
2023-03-01 18:15:09 +00:00
2023-09-18 22:14:58 +00:00
2023-04-04 22:05:49 +00:00
2024-03-26 11:12:38 +00:00
2024-03-21 10:00:36 +00:00
2022-04-27 10:26:25 +00:00
2023-06-30 14:03:03 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2022-06-24 08:20:39 +00:00
2021-11-04 18:57:21 +00:00
2023-08-25 18:55:32 +00:00
2023-06-16 10:22:23 +00:00
2022-07-25 12:21:59 +00:00
2023-09-12 08:13:12 +00:00
2022-04-21 11:06:39 +00:00
2024-04-29 14:18:01 +00:00
2024-03-26 11:12:38 +00:00
2023-03-15 20:05:38 +00:00
2023-03-15 20:05:38 +00:00
2024-03-26 11:12:38 +00:00
2021-12-20 21:40:33 +00:00
2021-12-22 00:02:44 +00:00
2023-04-04 22:05:49 +00:00
2024-04-23 17:35:09 +00:00
2023-04-22 00:38:28 +00:00
2022-11-09 19:15:04 +00:00
2024-03-26 11:12:38 +00:00
2024-03-26 11:12:38 +00:00
2024-03-26 11:12:38 +00:00
2021-08-04 21:50:48 +00:00
2024-03-15 17:21:30 +00:00
2022-08-23 13:53:42 +00:00
2022-10-10 21:04:18 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2023-01-24 18:00:25 +00:00
2024-03-15 17:21:30 +00:00
2021-12-23 16:41:45 +00:00
2023-03-02 21:29:56 +00:00
2023-09-27 08:35:08 +00:00
2023-11-17 20:17:23 +00:00
2021-04-15 16:54:57 +00:00
2021-04-17 00:39:26 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2021-05-11 18:25:24 +00:00
2021-06-07 20:56:53 +00:00
2024-09-10 15:29:28 +00:00
2021-08-23 20:05:27 +00:00
2021-08-18 23:19:55 +00:00
2021-08-13 22:18:17 +00:00
2021-08-06 00:01:51 +00:00
2021-11-04 18:57:21 +00:00
2024-03-15 17:21:30 +00:00
2021-10-12 17:03:00 +00:00
2021-11-18 17:12:18 +00:00
2022-01-05 16:11:54 +00:00
2022-01-27 21:11:41 +00:00
2023-03-30 20:34:09 +00:00
2022-03-14 17:00:39 +00:00
2024-06-24 22:00:28 +00:00
2022-11-17 17:20:18 +00:00
2024-03-26 11:12:38 +00:00
2022-06-17 10:05:18 +00:00
2023-03-01 18:15:09 +00:00
2022-07-06 11:04:10 +00:00
2022-07-13 14:09:53 +00:00
2023-05-24 20:03:38 +00:00
2024-03-15 17:21:30 +00:00
2023-11-17 13:10:01 +00:00
2023-02-06 11:00:29 +00:00
2024-03-26 11:12:38 +00:00
2023-04-19 17:25:31 +00:00
2023-04-26 17:33:50 +00:00
2023-05-16 22:36:22 +00:00
2023-05-22 15:17:07 +00:00
2023-05-30 23:41:19 +00:00
2023-05-31 14:04:39 +00:00
2023-10-10 17:54:08 +00:00
2023-09-26 18:27:39 +00:00
2023-09-22 17:48:12 +00:00
2024-03-26 11:12:38 +00:00
2023-12-04 16:20:50 +00:00
2024-02-12 17:54:32 +00:00
2023-11-29 20:07:37 +00:00
2023-12-01 23:15:58 +00:00
2024-01-08 13:07:16 +00:00
2024-03-15 17:21:30 +00:00
2024-03-22 19:03:31 +00:00
2024-03-15 17:21:30 +00:00
2024-03-08 15:35:20 +00:00
2024-04-05 16:14:39 +00:00
2024-04-18 13:42:21 +00:00
2024-05-08 21:10:29 +00:00
2024-05-06 14:12:52 +00:00
2024-05-08 21:10:29 +00:00
2024-05-30 10:09:46 +00:00
2024-06-06 09:14:18 +00:00
2024-06-25 14:34:20 +00:00
2024-07-29 19:09:58 +00:00
2024-07-09 18:00:39 +00:00
2024-08-30 16:11:40 +00:00
2024-03-26 11:12:38 +00:00
2024-03-15 17:21:30 +00:00
2022-10-10 21:04:18 +00:00
2022-07-12 19:25:32 +00:00
2023-04-19 17:25:31 +00:00
2024-04-16 14:39:48 +00:00
2022-02-17 21:29:11 +00:00
2024-03-15 17:21:30 +00:00
2021-12-16 17:52:29 +00:00
2021-05-26 16:02:10 +00:00
2021-09-07 14:32:22 +00:00
2021-09-07 14:32:22 +00:00
2022-02-25 18:36:02 +00:00
2024-03-26 11:12:38 +00:00
2023-01-04 15:26:34 +00:00
2023-01-31 16:47:44 +00:00
2024-02-09 14:59:40 +00:00
2022-07-25 12:21:59 +00:00
2022-10-03 12:36:18 +00:00
2021-10-12 08:32:24 +00:00
2024-02-07 10:24:09 +00:00
2024-05-08 17:03:59 +00:00
2023-12-20 12:23:56 +00:00
2023-03-31 13:20:19 +00:00
2024-05-01 17:19:16 +00:00
2021-12-23 16:41:45 +00:00
2024-03-15 22:24:24 +00:00
2023-04-04 22:05:49 +00:00
2021-11-04 18:57:21 +00:00
2023-02-08 12:07:57 +00:00
2024-04-10 14:54:27 +00:00
2022-02-23 16:55:52 +00:00
2024-04-29 14:18:01 +00:00
2024-02-13 23:32:01 +00:00
2023-06-29 17:27:48 +00:00
2023-09-19 15:50:58 +00:00
2022-12-06 04:04:23 +00:00
2024-03-15 17:21:30 +00:00
2022-11-29 14:36:19 +00:00
2023-01-30 18:29:59 +00:00
2023-12-05 17:25:39 +00:00
2024-03-26 11:12:38 +00:00
2024-05-11 08:53:29 +00:00
2023-03-21 15:25:10 +00:00
2024-09-10 21:07:18 +00:00
2022-05-20 08:16:41 +00:00
2021-05-24 22:53:07 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2024-04-29 14:18:01 +00:00
2024-03-18 20:56:24 +00:00
2022-07-25 12:21:59 +00:00
2023-10-17 07:41:49 +00:00
2021-12-23 16:41:45 +00:00
2024-04-16 14:39:48 +00:00
2024-03-15 17:21:30 +00:00
2023-09-06 18:10:33 +00:00
2021-05-12 13:35:00 +00:00
2024-03-26 11:12:38 +00:00
2022-01-07 14:22:26 +00:00
2024-03-15 17:21:30 +00:00
2023-04-04 22:05:49 +00:00
2024-04-19 08:10:18 +00:00
2024-07-18 10:00:11 +00:00
2024-07-18 10:00:11 +00:00
2024-04-23 09:45:21 +00:00
2024-07-18 10:00:11 +00:00
2024-04-19 08:10:18 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2023-04-04 22:05:49 +00:00
2022-07-22 07:05:26 +00:00
2024-03-15 17:21:30 +00:00
2024-03-15 17:21:30 +00:00
2024-04-23 22:01:13 +00:00
2022-03-22 19:45:03 +00:00
2021-12-13 11:26:17 +00:00
2022-03-22 19:45:03 +00:00
2021-09-02 19:47:45 +00:00