-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implement 'AsyncRefCell' and 'ResourceTable2' #8273
Conversation
d2df810
to
25a9007
Compare
Unfortunately it did not, and I do know why, and it is complicated ... |
Far from green, but this works:
|
I ran the benchmarks - there is some minimal performance degradation on linux (~5% slower) |
@@ -34,6 +34,7 @@ pub enum Op { | |||
/// Maintains the resources and ops inside a JS runtime. | |||
pub struct OpState { | |||
pub resource_table: crate::ResourceTable, | |||
pub resource_table_2: crate::resources2::ResourceTable, |
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.
nit: use resource_table2
- shorter.
/// cause the resource to be dropped. However, since resources are reference | ||
/// counted, therefore pending ops are not automatically cancelled. |
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.
Is this intentional design? I thought the main point of close
is to drop pending ops for the resource.
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
assert!(cell.try_borrow_mut().is_none()); | ||
assert!(cell.try_borrow().is_some()); | ||
} | ||
} |
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.
👍
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
No description provided.