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

Named service support #2352

Closed
astavonin opened this issue May 4, 2012 · 2 comments
Closed

Named service support #2352

astavonin opened this issue May 4, 2012 · 2 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@astavonin
Copy link
Contributor

We can come up with a public API to create global, singleton tasks, possibly with the following signatures:

   unsafe fn register_named_service<T>(n: str, f: fn~(port<T>))
   unsafe fn get_named_service<T>(n: str) -> chan<T>

This would, if the named service doesn't exist, create a new task and execute the specified function. You would use this in each test to create or retrieve a global service to manage your state. The big reservation I have about this is that we can not currently make this interface type safe - we can't even check the types at runtime.

Description was copied from mail-list.

@brson
Copy link
Contributor

brson commented May 4, 2012

Partially implemented in core::priv. Would benefit from #553. Requires #61 or reflection to be typesafe.

@Aatch
Copy link
Contributor

Aatch commented May 21, 2013

This doesn't look like it's valid any more. Re-open if you disagree.

@Aatch Aatch closed this as completed May 21, 2013
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Add a benchmark of the hang-on-test-failure code path

This is the code pattern that produces the performance problem in rust-lang/miri#2273

I figured out what I was stuck on in rust-lang/miri#2315 (comment). For a while I was just doing `let x: &[u8] = &[0u8; 4096];` but that doesn't produce the runtime inside `Stack::item_popped` that I was looking for, I think because this allocation is never deallocated. But with `Vec`, I get the profile I'm looking for.
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Fix small issue introduced by rust-lang#2311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants