-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Fix threading model #20465
Merged
woody-apple
merged 1 commit into
sve
from
cherry-pick-a7a70ae4cabaece900ed9ea95d29f3e00b9d2dd3
Jul 7, 2022
Merged
[Python] Fix threading model #20465
woody-apple
merged 1 commit into
sve
from
cherry-pick-a7a70ae4cabaece900ed9ea95d29f3e00b9d2dd3
Jul 7, 2022
+148
−209
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Fix Python Threading Model This fixes a number of issues with the Python REPL's threading model, namely: - Multiple, duplicated methods for stack initialization. - Stack initialization split across really odd places - Incorrect thread initialization - Incorrect order of initialization * Review feedback * Brought back the auto-stack init in native, albeit, a minimal version only. Updated ChipStack to now use native to implicitly achieve this auto init (which sets up MemoryInit) before continuining onwards with controller-style initialization. * Fix build
woody-apple
deleted the
cherry-pick-a7a70ae4cabaece900ed9ea95d29f3e00b9d2dd3
branch
July 7, 2022 22:36
PR #20465: Size comparison from afadb1c to 959b2a1 Increases (1 build for telink)
Decreases (3 builds for cc13x2_26x2, cyw30739, telink)
Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Fixes the threading issues identified in #20233.
Solution
GetLibraryHandle
.StackInit.cpp
, and consolidated all stack initialization logic in a single place:pychip_DeviceController_StackInit
. This now correctly orchestrates memory initialization, platform init, controller factory initialization and finally, starting up the Matter thread.PlatformMgr().StartEventLoopTask()
to start up the Matter thread.pychip_DeviceController_StackShutdown
to now actually be the symmetric mirror of init, AND, co-locate that next to Init to make it easy to read.Tests
Ran the patch in #20178 and ensured it passed.