Files
sdk/runtime/vm
Martin Kustermann 04195fcf14 [vm] A thread owning a safepoint operation should keep its mutator slot
Threads that own safepoint operations (e.g. a thread owning
[ReloadSafepointOperation]) are free to exit & re-enter. Owning a
safepoint operation only means that other threads are at well defined
places.

We limit the number of active mutators that can be running at the same
time - mainly due to the way our GC works today. This is maintained by
threads blocking on entering when there's too many mutators already.

If a thread owns a safepoint operation and exits, it should not give up
it's mutator slot to ensure it will be able to re-enter.

A concrete case when this can happen: We have many isolates and we run
in `--hot-reload-test-mode`. One isolate will own a reload safepoint
operation & perform reload. As part of reload it will exit the isolate
and send a request to the `kernel-service` and wait for it's reply. Once
it gets a replay it will re-enter the isolate. Now this re-entering
could be blocking if another thread took the mutator slot (which can
happen, as we get mutator slot before we try to check-in to safepoint
when entering).

In the future we may unify the safepoint mechanism with the mutator
count mechanism.

Closes https://github.com/dart-lang/sdk/issues/52441
TEST=Fixes flaky timeouts of ffi/invoke_callback_after_suspension_test

Change-Id: Icc5dbf59b4270653c9e6e316531f5b3e086db2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304682
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-05-22 12:41:38 +00:00
..
2023-01-18 21:08:38 +00:00
2023-03-06 22:06:59 +00:00
2023-03-06 22:06:59 +00:00
2023-04-28 19:29:36 +00:00
2023-01-20 12:37:49 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2023-04-28 19:29:36 +00:00
2022-01-20 00:57:57 +00:00
2022-09-12 12:33:57 +00:00
2022-09-12 12:33:57 +00:00
2023-01-24 18:00:25 +00:00
2023-04-28 19:29:36 +00:00
2023-03-29 18:11:49 +00:00
2023-04-21 22:41:28 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:29:36 +00:00
2022-01-20 00:57:57 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:37:10 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:29:36 +00:00
2022-12-29 10:18:02 +00:00
2023-01-06 07:48:22 +00:00
2022-07-29 18:11:01 +00:00
2023-04-28 19:29:36 +00:00
2023-04-28 19:29:36 +00:00
2023-04-12 22:18:54 +00:00
2023-03-06 22:06:59 +00:00
2023-01-09 15:48:57 +00:00
2022-09-10 15:12:35 +00:00
2023-04-21 22:41:28 +00:00
2023-04-12 22:18:54 +00:00