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

Scheduler multithreading #6821

Closed
wants to merge 16 commits into from
Closed

Scheduler multithreading #6821

wants to merge 16 commits into from

Conversation

brson
Copy link
Contributor

@brson brson commented May 30, 2013

r? @nikomatsakis

This implements very basic multithreading in the new scheduler. This is only using a trivial work sharing strategy with a shared task queue. It adds three new concurrent types to the scheduler: WorkQueue, MessageQueue, and SleeperList. WorkQueue is temporarily just a basic queue; MessageQueue is a multiple-producer, singe-consumer queue for sending messages to schedulers, and SleeperList is a shared stack used for waking up sleeping schedulers. All three are intended to be lock free but for now are implemented naively with locks.

The main scheduling routine, which uses all three of these data structures is here: https://github.com/brson/rust/blob/io-upstream/src/libstd/rt/sched.rs#L144

An example of how the multithreaded scheduler is constructed: https://github.com/brson/rust/blob/io-upstream/src/libstd/rt/test.rs#L62
#4419

@brson
Copy link
Contributor Author

brson commented May 30, 2013

This also pulls in one of @Aatch's patches to add atomic ints. In the meantime he's upstreamed a more complete implementation. I'll switch the scheduler over and delete this version later.

@brson
Copy link
Contributor Author

brson commented May 30, 2013

This isn't utilizing all threads effectively. Still investigating.

@brson
Copy link
Contributor Author

brson commented May 30, 2013

I'm going to hold on to this for a while to work out some kinks.

@brson brson closed this May 30, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 25, 2021
…p1995

Write literal suggestion

fixes: rust-lang#6768

changelog: Add suggestion to `write_literal` and `print_literal` lints
changelog: Change `use_debug` to point only at the format string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants