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

Add "interleave_tasks_here()" calls inside sync libs, togglable with #[cfg(test)] #7074

Closed
bblum opened this issue Jun 11, 2013 · 3 comments
Closed
Labels
A-concurrency Area: Concurrency A-testsuite Area: The testsuite used to check the correctness of rustc 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 Jun 11, 2013

This would be sort of a little-kid version of #6957, but also possibly a gateway into getting same off the ground. The idea:

#[inline(always)] #[cfg(test)]
fn interleave() { for some_random_number().times { task::yield() } }
#[inline(always)] #[cfg(not(test))]
fn interleave() { }

Then inside the concurrency primitives, whenever you wish you could insert an artificial preemption for testing purposes, you would call that.

@ghost ghost assigned bblum Jun 11, 2013
@bblum
Copy link
Contributor Author

bblum commented Aug 19, 2013

This is also pending a clear notion of yield() in the new runtime, which we don't have yet. Unassigning myself.

@flaper87
Copy link
Contributor

visiting for triage. nothing to add here.

@thestinger
Copy link
Contributor

#17325 means this is no longer relevant to the standard libraries

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 22, 2021
Split `is_diagnostic_assoc_item`

changelog: none

* Split `is_diagnostic_assoc_item` into `is_diag_item_method` and `is_diag_trait_item`
  * `is_diag_item_method` is a bit more nuanced with the `tcx.type_of(impl_id).ty_adt_def()` step, so it seems better to keep that separate.
  * No need to generalize over traits and Adt's since we know which one we want at compile time
  * "item" vs. "method" because a trait may have associated items.
* Replaces the usage of the `sym::slice` diagnostic item with the `slice_alloc` lang item. The diagnostic item should be removed from rustc because it is on the `slice_alloc` impl, not slice itself (and it's not needed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Concurrency A-testsuite Area: The testsuite used to check the correctness of rustc 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

3 participants