Skip to content

Conversation

@steveklabnik
Copy link
Contributor

This is a little rough, and it needs squashed and section headers, but i'd like to get some eyes on it sooner rather than later.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@steveklabnik
Copy link
Contributor Author

oh, and i might not need the channel at the end: https://twitter.com/florob/status/597935275394912259

considering an extra 'cleanup' section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"has is" -> "is"

@steveklabnik
Copy link
Contributor Author

I believe all nits are addressed. r? @alexcrichton

@Florob
Copy link
Contributor

Florob commented May 12, 2015

So, maybe I'm just terribly dense, but I still don't see why you need the channel at all. AFAICT, it does not become obsolete by joining the threads, but is unnecessary from the get go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still kinda worried about all these .ok().expect(...) calls throughout these examples, some of them I think may be giving the wrong impression. For example this doesn't really indicate anything about "couldn't finish eating" but rather that no one's listening for the notification that the eating is done. Down below there's:

.ok().expect("Couldn't aquire left mutex");

If Err is returned, though, the mutex was indeed acquired, it was just poisoned.

Would it be possible to just use unwrap everywhere? I would consider unwrap as the idiomatic way to indicate that an error should not ever be happening here, and errors should definitely not ever be happening in these examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I've seen people mostly argue that unwrap gives a poor error message, and ok/expect at least lets you customize it.

that said, I'm sympathetic to the last thing you've said, so yeah, let me re-work it.

@alexcrichton
Copy link
Member

I do also agree with @Florob that the channel involvement here may not be pulling its weight by the time we get to the end.

@steveklabnik
Copy link
Contributor Author

I added a thing at the end about removing the channel entirely.

@steveklabnik
Copy link
Contributor Author

@Florob yeah, maybe that is true. sigh.

@steveklabnik
Copy link
Contributor Author

Okay, I removed the channels entirely, and use unwrap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and report back that they're done", perhaps drop this phrase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch. editing your own prose is so hard :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need to be rephrased as it's not just a plain vector instead of an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alexcrichton
Copy link
Member

Looks good to me! A few last minor nits and otherwise r=me

Nice chapter @steveklabnik!

@steveklabnik
Copy link
Contributor Author

@bors: r=alexcrichton rollup

@bors
Copy link
Collaborator

bors commented May 12, 2015

📌 Commit 2ba6169 has been approved by alexcrichton

steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 13, 2015
…xcrichton

This is a little rough, and it needs squashed and section headers, but i'd like to get some eyes on it sooner rather than later.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 13, 2015
…xcrichton

This is a little rough, and it needs squashed and section headers, but i'd like to get some eyes on it sooner rather than later.
bors added a commit that referenced this pull request May 13, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blegh, I think this is already being tested in a rollup, but maybe there will be a quick chance to fix a couple things soon.

s/mult-threading/multi-threading/

Edit: Never mind, I was missing a paragraph. This is the only nit I found.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a new PR for master, and work it into my backport. Thanks!

@bors bors merged commit 2ba6169 into rust-lang:master May 13, 2015
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.

9 participants