-
Notifications
You must be signed in to change notification settings - Fork 6k
Run Dart VM tasks on the engine's ConcurrentMessageLoop instead the VM's separate thread pool. #29819
Run Dart VM tasks on the engine's ConcurrentMessageLoop instead the VM's separate thread pool. #29819
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
The approach looks good to me. cc @iskakaushik |
|
I had a PR that essentially does the same and was waiting for the dart roll to get done :) |
7620b7c to
7dcfb30
Compare
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but a test for this would be nice. Here is how to test this:
- In one of the unit-test harnesses (say a variant of
DartIsolateTest::RootIsolateCreationAndShutdownindart_isolate_unittests.cc), launch a VM. - From the
vm_ref, get a reference to the concurrent message loop viaDartVM::GetConcurrentMessageLoop. - Post a task to all worker threads via
fml::ConcurrentMessageLoop::PostTaskToAllWorkers. In the task, set a thread local variable using the portable container infml/thread_local.h. - Create a new Dart fixture and from its entrypoint, launch a new isolate.
- In the new isolate, define a native entrypoint.
- Once back in native code, seek the thread local you just set set in the earlier steps.
- Add a test assertion that checks that we are running on one of the concurrent pools workers.
I suppose a native entrypoint directly from the root isolate would be fine as the UI thread is not part of the concurrent workers. But the above steps just prove that the engine now hosts background isolates.
Thanks!
|
Oh, I forgot to mention, to ensure your TLS slots on the workers are filled, you will need an |
1e50986 to
8566967
Compare
iskakaushik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
8566967 to
af8ff78
Compare
…M's separate thread pool. Bug: dart-lang/sdk#44228
af8ff78 to
0abd87e
Compare
…ad the VM's separate thread pool. (flutter/engine#29819)
…ad the VM's separate thread pool. (flutter/engine#29819)
…ad the VM's separate thread pool. (flutter/engine#29819)
…ad the VM's separate thread pool. (flutter/engine#29819)
* 9b200e1 Roll Dart SDK from 9f61c2487bbd to 3a963ff14181 (7 revisions) (flutter/engine#30011) * fada035 Use WindowInfoTracker.Companion.getOrCreate instead of the short version (flutter/engine#30012) * d280475 Non painting platform views (flutter/engine#30003) * b420c16 [macOS] MacOS Keyboard properly handles multi-char characters (flutter/engine#30005) * 0a6098b [Win32, keyboard] Fix dead key events that don't have the dead key mask (flutter/engine#30004) * 8ac9366 Fix sceneElement analysis error (flutter/engine#30038) * 5ad06c2 Share the io_manager between parent and spawn engine (flutter/engine#29915) * 69be405 Run Dart VM tasks on the engine's ConcurrentMessageLoop instead the VM's separate thread pool. (flutter/engine#29819) * c85a129 Roll Dart SDK from 3a963ff14181 to 8bb2e56ec900 (4 revisions) (flutter/engine#30045) * abf6c34 Eliminate hardcoded scale factor in a11y scroll (flutter/engine#30013) * d184d9b Roll Skia from fa183572bfd3 to d3399178196e (17 revisions) (flutter/engine#30047) * 476ed30 Roll web_installers simulators package (flutter/engine#30035) * 62113c4 Revert dart to 9f61c2487bbd (flutter/engine#30056)
…ad the VM's separate thread pool. (flutter#29819)" This reverts commit 69be405.
This limits the number of threads that can be contending for cores.
Bug: dart-lang/sdk#44228