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

What happens when the runtime runs out of task ids? #1767

Closed
brson opened this issue Feb 6, 2012 · 6 comments
Closed

What happens when the runtime runs out of task ids? #1767

brson opened this issue Feb 6, 2012 · 6 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Feb 6, 2012

Currently the runtime assigns task id's (intptr_t) to each task, starting at 0. When the current task id hits INTPTR_MAX the runtime theoretically fails an assert and crashes. Would be sweet if the runtime didn't crash in this situation. Ports within a single task also have a similar problem, and soon schedulers will as well.

@bnoordhuis
Copy link
Contributor

It's probably a naive question but why don't you change rust_task_id to uint64_t and call it a day? I can see 2^31 overflowing given enough time but 2^64?

@brson
Copy link
Contributor Author

brson commented Feb 7, 2012

That sounds like a reasonable solution to me.

@ghost ghost assigned brson Feb 8, 2012
@brson
Copy link
Contributor Author

brson commented Mar 19, 2012

I tried to implement this and hit some weird test failures on windows. Didn't investigate further.

@thestinger
Copy link
Contributor

@brson: is this still an issue? it seems like the scheduler could use the address of the first stack segment as a unique identifier

@toddaaro
Copy link
Contributor

toddaaro commented Jul 3, 2013

Stumbled across this. The newsched runtime doesn't actually have task ids, so this shouldn't be a bug anymore. @brson, should we just close it?

If task ids do end up a concept again, they will likely be a concept in a library wrapping tasks with "fun features", and so not the domain of the core runtime.

@brson
Copy link
Contributor Author

brson commented Jul 19, 2013

Obsolete in the new runtime.

@brson brson closed this as completed Jul 19, 2013
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 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

4 participants