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

Issues with rust-level lock_and_signal #2781

Closed
bblum opened this issue Jul 2, 2012 · 1 comment
Closed

Issues with rust-level lock_and_signal #2781

bblum opened this issue Jul 2, 2012 · 1 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. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@bblum
Copy link
Contributor

bblum commented Jul 2, 2012

The lock_and_signal implemented in libcore/sys.rs has two issues:

  • Being killed, or even yielding at all, while holding one of these locks can cause deadlock, especially if another task runs on the same core that tries to take the lock. This will bite us hard as soon as the compiler starts inserting yield-checks.
    -- Easy solution: Add a preempt_disable counter in the rt scheduler, à la linux spinlocks, that it checks every yield
    -- Hard solution: Make the scheduler know how to reschedule to the owner of a lock on the same core. (Still requires unkillable, I think)
  • fn lock(fn() -> T) -> T is a cute interface, but doesn't support lock interleaving. Add acquire/release.
@ghost ghost assigned bblum Jul 2, 2012
@bblum
Copy link
Contributor Author

bblum commented Jul 23, 2012

dup of #2795

@bblum bblum closed this as completed Jul 23, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
…#4239)

* Pick up comments between visibility modifier and item name

I don't think this hurts to fix. rust-lang#2781, which surfaced this issue, has
a number of comments relating to similar but slightly different issues
(i.e. dropped comments in other places). I can mark rust-lang#2781 as closed and
then will open new issues for the comments that are not already resolved
or tracked.

Closes rust-lang#2781

* fixup! Pick up comments between visibility modifier and item name

* fixup! Pick up comments between visibility modifier and item name
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. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

1 participant