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 thread tasks #8474

Closed
brson opened this issue Aug 12, 2013 · 3 comments
Closed

Add thread tasks #8474

brson opened this issue Aug 12, 2013 · 3 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@brson
Copy link
Contributor

brson commented Aug 12, 2013

Add a type of task that is not a green thread. This is a task that would run on the thread's stack and would not do user-space context switching. This would allow things like unwinding and TLS to work without green threads.

cc #6855
cc #7282

@toddaaro
Copy link
Contributor

To make this work, we just build a task struct, put it in TLS, and that is it? I guess we have a ThreadTask enum in the task_type field. The "start" function would be a bit different, and we could leave out the Coroutine.

The hard part here might be refactoring Task to permit three whole task types. With only two that share almost every field things are pretty easy, but with three more fields should end up inside TaskType which means more syntactically kludgey accessor functions.

@brson
Copy link
Contributor Author

brson commented Aug 18, 2013

Yes, the task would live in TLS for the duration of some main function. It would be very similar to SchedTask.

@alexcrichton
Copy link
Member

Closing in favor of #10493, this should also get closed by #10965.

flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 26, 2022
Replace some more paths with diagnostic items

cc rust-lang#5393

Replaces the macro & mem paths, and catches a couple others that were unused

changelog: none
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
Projects
None yet
Development

No branches or pull requests

3 participants