-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fiber#status #16
Comments
We might want to specify a status to This in turns means we'd need |
Merging both booleans is theoretically a good idea, but it's not easy in practice, as once the fiber is dead, its status musn't change anymore but |
Perhaps we could only flip a single bit in |
Of course, a flags enum! |
It would valuable to know the current status of a Fiber. Implementing this is easy, but we currently have two booleans to reflect a fiber's status:
@alive
to tell whether the fiber is dead or alive;@context.resumable
to tell whether the fiber is running or suspended;It could be interesting to group these into a single variable (enum), and maybe make it an atomic (set once in the target specific context switch assembly) which might be useful for #15.
Note: we could eventually have sub-states in addition to suspended (e.g. sleep or waiting on something: mutex, channel, event-loop, ...). Useful in combination to crystal-lang/perf-tools#18
The text was updated successfully, but these errors were encountered: