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

Port pipes to pthreads #4770

Closed
brson opened this issue Feb 3, 2013 · 13 comments
Closed

Port pipes to pthreads #4770

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

Comments

@brson
Copy link
Contributor

brson commented Feb 3, 2013

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.

@brson
Copy link
Contributor Author

brson commented Feb 4, 2013

Related to #4419

@brson
Copy link
Contributor Author

brson commented Feb 4, 2013

@eholk Does this sound reasonable? Do you have any advice? I think there are 7 calls to rustrt and task that pipes relies on.

@eholk
Copy link
Contributor

eholk commented Feb 11, 2013

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.

@brson
Copy link
Contributor Author

brson commented Feb 11, 2013

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.

@bblum
Copy link
Contributor

bblum commented Feb 28, 2013

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.

@brson
Copy link
Contributor Author

brson commented Mar 1, 2013

I imagine it blocking the thread in that case.

@bblum
Copy link
Contributor

bblum commented Mar 1, 2013

I mean, if pipes rely on being able to block, and the scheduler (which implements block) relies on pipes for synchronization...

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

This is still part of the new-sched plan? Feels like it might fall out pretty directly from 1:1 mode in scheduler.

@brson
Copy link
Contributor Author

brson commented Apr 30, 2013

@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.

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

assigning bug; change assignment if you disagree

@ghost ghost assigned brson Apr 30, 2013
@brson
Copy link
Contributor Author

brson commented May 1, 2013

Not a 0.7 priority.

@emberian
Copy link
Member

emberian commented Aug 5, 2013

Visiting for triage; nothing to add

@huonw
Copy link
Member

huonw commented Nov 10, 2013

Triage: the pipes compiler was removed in #8170 so I'm closing this; it may reappear if #7668 ever happens, but we can worry about running it on pthreads then.

@huonw huonw closed this as completed Nov 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Concurrency 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

6 participants