You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if a task holding a write lock finishes modifying data and wants to allow concurrent reads, it must drop the write lock and then re-acquire a read lock. This process is inefficient and can introduce potential race conditions in the time between dropping the write lock and acquiring the read lock.
This was identified as a potential future improvement during the work on PR #61.
This issue proposes adding a downgrade() method to RwLockWriteGuard. This would allow a task to atomically convert an exclusive write lock into a read lock (RwLockReadGuard).This improves performance and throughput by allowing read operations to proceed immediately without contention from other pending write locks.
This is a common and proven feature in other major Rust libraries:
Hi, @tisonkun , Could I be assigned this issue? Just wanted to gently follow up on this proposal to make sure it wasn't overlooked. Alternatively, should I just go ahead and create a PR directly without an assignment, since this proposal has been discussed before? I'm not sure if you've seen this issue.
But since you're the issue creator and you spend time on this, based on our previous collaboration, I can assign this issue to you.
Typically, I seldom assign issue to certain person unless I know he/she would work on it. Otherwise it's no more than a signal that: "Someone has already taken the issue and I should go away". But often the assignee vanishes later and it prevents others to take it over :D
But since you're the issue creator and you spend time on this, based on our previous collaboration, I can assign this issue to you.
Typically, I seldom assign issue to certain person unless I know he/she would work on it. Otherwise it's no more than a signal that: "Someone has already taken the issue and I should go away". But often the assignee vanishes later and it prevents others to take it over :D
Thank you for the quick reply and for assigning the issue to me. Actually, I noticed you didn't assign the issue last time and suspected it was your usual practice. I just wanted to confirm cautiously since I hadn't heard back yet. I completely understand your philosophy on assignments, and I really appreciate the trust.
I'll get started on the implementation and will submit a PR when it's ready for review.
Activity
orthur2 commentedon Aug 8, 2025
Hi, @tisonkun , Could I be assigned this issue? Just wanted to gently follow up on this proposal to make sure it wasn't overlooked. Alternatively, should I just go ahead and create a PR directly without an assignment, since this proposal has been discussed before? I'm not sure if you've seen this issue.
tisonkun commentedon Aug 8, 2025
You can directly submit a PR.
But since you're the issue creator and you spend time on this, based on our previous collaboration, I can assign this issue to you.
Typically, I seldom assign issue to certain person unless I know he/she would work on it. Otherwise it's no more than a signal that: "Someone has already taken the issue and I should go away". But often the assignee vanishes later and it prevents others to take it over :D
orthur2 commentedon Aug 8, 2025
Thank you for the quick reply and for assigning the issue to me. Actually, I noticed you didn't assign the issue last time and suspected it was your usual practice. I just wanted to confirm cautiously since I hadn't heard back yet. I completely understand your philosophy on assignments, and I really appreciate the trust.
I'll get started on the implementation and will submit a PR when it's ready for review.
tisonkun commentedon Aug 30, 2025
@orthur2 This should be resolved by #65?
orthur2 commentedon Aug 30, 2025
Yes, exactly. Since you just merged the fix in #65, we can close this issue now. Thanks.