Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Question: Are we intended to pass contexts between threads? #7

Open
ckaran opened this issue Nov 18, 2020 · 0 comments
Open

Question: Are we intended to pass contexts between threads? #7

ckaran opened this issue Nov 18, 2020 · 0 comments
Assignees

Comments

@ckaran
Copy link

ckaran commented Nov 18, 2020

I want to eventually write a crate that is like a mashup between a coroutine library and futures. That is, there are a very large set of coroutines that are being multiplexed onto a small number of threads in a thread pool. When a coroutine is blocked waiting for something, I want to save its context, and put it into a ring buffer to try again at a later date. The issue is that the thread that saved the context may not be the thread that picks up the context to continue execution. Is this a supported mode of operation? I did read the requirement that all pointers in the non-volatile registers must still be valid, which I think I can ensure by either requiring closures with move semantics, or closures that only reference stuff on the heap, but I didn't see anything else to suggest that what I'm doing is right or wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants