-
Notifications
You must be signed in to change notification settings - Fork 132
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
628-thread-safe-subclass-mode: shared pointer abstraction #1339
base: main
Are you sure you want to change the base?
628-thread-safe-subclass-mode: shared pointer abstraction #1339
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi, first thoughts:
|
Thanks for the quick feedback! ✨
Okay, I'll dig in deeper into the engine stuff and see where to go from here.
Yes, hopefully by the end of the year in 1.75.0. But, I'll give it a shot on stable for now! |
Marking this ready for review, noting the pending todos listed above. Would love any feedback on the implementation before I move onto those housekeeping items. I must admit, the programming model of this crate breaks my brain a bit when it comes to thinking about how to document the possibility for deadlocks, but I think writing some more tests will help here. |
I think there's a bit of trickiness here relating to the chosen ownership model and whether code generated by
The safest thing to do is just accept the possibility of deadlocks. However, I think it might still be possible to check what kind of holder we have first and provide the good error message in the event we are calling a mutable receiver with an owned peer only. Will have to think more about this. |
Parent issue: #628
Wanted to open this as a draft to get feedback before going any deeper. Using some ugly trait shenanigans to paper over
Rc<RefCell<T>>
andArc<RwLock<T>>
.Outstanding comments/questions/issues:
Rc<RefCell<T>>
there for now just to get tests to pass. I think there might be a better API here, or at least need advice on how best to approach this.As an aside, I'm using the subclass functionality for a project and it is literally lifesaving. This feature would be helpful for ensuring additional safety since I'm interfacing with a parent application's plugin API that does #whoknows with references we give them.
TODO: