Skip to content
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

Investigate replacing O(n) locking with refcounting tasks in taskgroup killing #3100

Closed
bblum opened this issue Aug 3, 2012 · 3 comments
Closed
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@bblum
Copy link
Contributor

bblum commented Aug 3, 2012

Described in a comment on #3098. Worth making a perf test about. Requires adding two runtime calls for ref-ing and deref-ing task pointers.

@ghost ghost assigned bblum Aug 3, 2012
@eholk
Copy link
Contributor

eholk commented Aug 3, 2012

You might be able to avoid the runtime calls by using the atomic intrinsics that I added to Rust.

@bblum
Copy link
Contributor Author

bblum commented Aug 3, 2012

I'd rather not... *rust_task is an opaque pointer type for good reason (and there's already an atomic refcount inside).

@bblum
Copy link
Contributor Author

bblum commented Aug 6, 2012

Conclusion: Not worth it. Significant increase to design complexity (easier to introduce a memory-management bug), and performance gain not outweighed by orthogonal performance hit.

Performance with task-perf-jargon-metal-smoke, where the perf win doesn't show up, exhibiting the perf hit: http://bblum.net/images/perf-refcount-vs-exclusive/100-generations.svg
Performance with task-perf-linked-failure, where the perf win shows up and seems to balance the hit: http://bblum.net/images/perf-refcount-vs-exclusive/linked-failure.svg

@bblum bblum closed this as completed Aug 6, 2012
bblum added a commit to bblum/rust that referenced this issue Aug 12, 2013
…lock for O(n) time, cf rust-lang#3100, and optimize out several unneeded clone()s.
@bblum bblum removed their assignment Jun 16, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Fix poor formatting of empty trait with generic bounds
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants