WIP: support_string_class_attr #415
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#415
Loading…
Reference in New Issue
No description provided.
Delete Branch "support_string_class_attr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The main changes are as follows:
nac3artiq/src/lib.rs:
nac3artiq/src/symbol_resolver.rs
Also added two files under nac3artiq/demo for testing the new changes
b3b34481d4
to2470ab7856
@ -603,3 +613,1 @@
if object_id == def_id
&& constructor.is_some()
&& methods.iter().any(|(s, _, _)| s == &"__init__".into())
if let Some(rear_guard) = def.try_read() {
rear_guard ?
The previous code entered deadlock since the last element inside the def was locked (not sure about the reason for this), so to avoid that, I replaced the read() function with try_read to prevent the blocking behavior.
Sounds like the code would then fail randomly instead of deadlocking, then?
From what I have tested, only the last element inside the class definitions was locked. I was unable to see what it corresponded to in the class, but methods including the constructor were already processed. I think avoiding deadlock here should be more important as the code after it can give more meaningful error messages. I will further look into the reason for this blocking and update here.
Please break it into another PR while you investigate it.
@ -302,2 +304,3 @@
self.helper.id_fn.call1(py, (self.helper.type_fn.call1(py, (pyty,))?,))?.extract(py)?;
let py_obj_id: u64 = self.helper.id_fn.call1(py, (pyty,))?.extract(py)?;
let get_def_id = || {
This is only used once. Worth defining?
Added this at the top for clarity in if condition, but yes since it is used only once, will rewrite this and move it with the calling condition.
The PR text should be the commit log. And shouldn't "Updated Constructor function detection in get_obj_type function to avoid deadlock when performing read on definitions" be split into another PR?
support_string_class_attrto WIP: support_string_class_attrSplitting PR for Clarity
I have split the PR into two separate PRs for better clarity and management.
I am closing the current PR, #415, as its contents are now represented by the two new PRs listed above.
Pull request closed