-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Port pipes to pthreads #4770
Comments
Related to #4419 |
@eholk Does this sound reasonable? Do you have any advice? I think there are 7 calls to |
What do you mean by porting pipes to pthreads? I think we mostly rely on the runtime for cases where the task needs to go to sleep or be woken up when passing messages. We already implement synchronization manually with atomic operations, so calling into pthreads when we need the OS/runtime to be aware of synchronization doesn't seem like too much of a stretch. |
I mean that I want (an incarnation of ) pipes to work without the Rust scheduler. I'm still not sure we need it - work stealing scheduler's primarily communicate through the work queue - but if we had it we could probably use it. |
I can't see this being simple. The fastpath would cause no trouble, but pipes need to block, which is pretty much the most important operation the scheduler does. Sounds fun, though. |
I imagine it blocking the thread in that case. |
I mean, if pipes rely on being able to block, and the scheduler (which implements block) relies on pipes for synchronization... |
This is still part of the new-sched plan? Feels like it might fall out pretty directly from 1:1 mode in scheduler. |
@graydon I'm still not sure that it is needed, though it probably is desirable. Even in 1:1 mode you would still be operating within a task, just one that has the entire thread to itself, so this wouldn't apply. Where this is still potentially useful is for communicating between tasks and non-tasks, and possibly for communicating between schedulers themselves. I only have one case currently where it is important for schedulers to send messages between each other and that is when one scheduler needs to schedule a task that is pinned to some other scheduler. We may end up wanting a special message queue tailored just to schedulers, and integrating with the event loop, for this purpose though. |
assigning bug; change assignment if you disagree |
Not a 0.7 priority. |
Visiting for triage; nothing to add |
I would like to use pipes to implement the new scheduler. The interface between pipes and the runtime is pretty thin, so I think we can abstract it out.
The text was updated successfully, but these errors were encountered: