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-28 06:34:09 +00:00
2023-10-11 18:41:57 +00:00
2023-04-12 01:11:05 +00:00
2024-04-05 19:38:12 +00:00
2024-09-03 19:53:58 +00:00
2023-04-12 01:11:05 +00:00
2024-08-07 12:59:35 +00:00
2023-04-12 01:11:05 +00:00
2024-07-26 19:26:11 +00:00
2024-07-10 19:45:29 +00:00
2024-07-10 19:45:29 +00:00
2024-04-17 19:14:41 +00:00
2023-04-12 20:32:29 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2024-05-16 16:33:52 +00:00
2024-04-17 19:14:41 +00:00
2023-10-31 17:11:51 +00:00
2023-10-31 17:11:51 +00:00
2024-06-18 09:10:00 +00:00
2024-05-29 10:16:28 +00:00
2024-07-10 19:45:29 +00:00
2024-07-10 19:45:29 +00:00
2024-06-06 19:10:19 +00:00
2024-05-29 10:16:28 +00:00
2024-04-17 19:14:41 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2024-08-15 17:51:10 +00:00
2024-01-11 23:54:59 +00:00
2024-03-12 08:29:36 +00:00
2024-04-10 01:41:57 +00:00
2023-07-14 01:31:38 +00:00
2023-04-12 20:32:29 +00:00
2024-04-17 19:14:41 +00:00
2024-08-06 12:26:19 +00:00
2024-02-09 14:10:49 +00:00
2024-08-06 12:26:19 +00:00
2023-05-02 07:32:30 +00:00
2024-08-06 12:26:19 +00:00
2023-01-25 14:08:27 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2023-04-12 01:11:05 +00:00
2024-08-06 12:26:19 +00:00
2024-06-06 19:10:19 +00:00
2024-06-06 19:10:19 +00:00
2024-02-09 14:10:49 +00:00
2023-01-06 07:48:22 +00:00
2024-05-29 10:16:28 +00:00
2024-05-29 10:16:28 +00:00
2024-05-29 10:16:28 +00:00
2024-04-17 19:14:41 +00:00
2024-02-09 14:10:49 +00:00
2024-08-07 12:59:35 +00:00
2024-08-06 12:26:19 +00:00
2023-07-04 13:10:42 +00:00
2024-04-17 19:14:41 +00:00
2024-08-15 17:51:10 +00:00
2024-08-15 17:51:10 +00:00
2024-07-30 18:08:46 +00:00
2024-05-29 10:16:28 +00:00
2024-08-20 18:13:33 +00:00
2024-08-20 18:13:33 +00:00
2024-07-24 21:58:10 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2024-07-17 16:47:50 +00:00
2024-07-17 16:47:50 +00:00
2024-02-09 14:10:49 +00:00
2024-02-09 14:10:49 +00:00
2023-04-18 20:56:00 +00:00
2024-02-09 14:10:49 +00:00
2024-08-20 18:13:33 +00:00
2024-09-12 15:16:12 +00:00
2024-01-31 19:32:09 +00:00
2024-09-12 15:16:12 +00:00
2022-09-13 21:16:28 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2024-06-26 11:10:06 +00:00
2023-04-12 01:11:05 +00:00
2024-09-12 01:15:27 +00:00
2023-01-16 15:12:38 +00:00
2024-08-29 20:40:06 +00:00
2024-06-12 20:51:31 +00:00
2023-01-16 15:12:38 +00:00
2024-04-17 19:14:41 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2024-03-12 08:29:36 +00:00
2023-04-12 20:32:29 +00:00
2023-04-12 20:32:29 +00:00
2024-06-26 11:10:06 +00:00
2024-06-12 16:45:19 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2023-09-05 22:15:58 +00:00
2024-02-09 14:10:49 +00:00
2024-08-07 19:28:10 +00:00
2024-04-17 19:14:41 +00:00
2023-04-12 01:11:05 +00:00
2023-09-05 22:15:58 +00:00
2024-04-17 19:14:41 +00:00
2024-02-09 14:10:49 +00:00
2023-06-19 00:25:12 +00:00
2023-04-12 01:11:05 +00:00
2024-08-06 12:26:19 +00:00
2023-09-05 22:15:58 +00:00
2023-04-12 20:32:29 +00:00
2023-07-11 15:13:58 +00:00
2023-04-12 01:11:05 +00:00
2023-10-31 17:11:51 +00:00
2024-03-21 19:50:46 +00:00
2023-08-11 16:28:46 +00:00
2023-04-12 20:32:29 +00:00
2024-07-01 21:00:00 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2024-01-31 19:24:29 +00:00
2023-04-12 01:11:05 +00:00
2024-02-09 14:10:49 +00:00
2024-01-25 08:23:51 +00:00
2023-12-11 17:49:58 +00:00
2024-07-01 21:00:00 +00:00
2023-04-12 20:32:29 +00:00
2022-08-17 16:18:35 +00:00
2024-05-31 21:12:28 +00:00
2024-05-31 21:12:28 +00:00
2024-04-17 19:14:41 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2024-02-09 14:10:49 +00:00
2024-08-06 12:26:19 +00:00
2023-06-09 08:29:30 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2024-02-09 14:10:49 +00:00
2024-04-17 19:14:41 +00:00
2024-08-06 12:26:19 +00:00
2024-04-17 19:14:41 +00:00
2024-04-17 19:14:41 +00:00
2022-05-31 15:36:33 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 01:11:05 +00:00
2022-05-31 15:36:33 +00:00
2024-02-09 14:10:49 +00:00
2023-04-12 01:11:05 +00:00
2023-04-12 20:32:29 +00:00
2023-04-12 20:32:29 +00:00
2023-04-12 20:32:29 +00:00
2022-03-09 18:02:34 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2024-08-07 12:59:35 +00:00
2024-01-26 22:08:37 +00:00
2024-06-26 11:10:06 +00:00
2024-06-26 11:10:06 +00:00
2024-06-26 11:10:06 +00:00
2023-04-12 01:11:05 +00:00
2024-02-09 14:10:49 +00:00
2024-04-17 19:14:41 +00:00
2024-03-12 08:29:36 +00:00
2024-05-29 10:16:28 +00:00
2023-04-12 01:11:05 +00:00
2024-01-11 22:24:44 +00:00
2023-04-12 01:11:05 +00:00
2024-03-21 19:50:46 +00:00
2024-03-21 19:50:46 +00:00