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

Mutex chapter #105

Closed
japaric opened this issue Jun 17, 2014 · 12 comments
Closed

Mutex chapter #105

japaric opened this issue Jun 17, 2014 · 12 comments

Comments

@japaric
Copy link
Member

japaric commented Jun 17, 2014

Come up with some examples of using Mutex and add them under https://rustbyexample.com/std.html

@japaric japaric mentioned this issue Jun 17, 2014
52 tasks
@japaric japaric added C-hold and removed C-hold labels Jun 17, 2014
@brson
Copy link
Contributor

brson commented Jun 27, 2016

No movement. If somebody adds Mutexes then so be it. Closing.

@brson brson closed this as completed Jun 27, 2016
@brson
Copy link
Contributor

brson commented Jun 27, 2016

Actually, I'm going to see if volunteers can be stirred up.

@brson brson reopened this Jun 27, 2016
@brson brson removed the C-taken label Jun 27, 2016
@brson
Copy link
Contributor

brson commented Jun 27, 2016

Just come up with some examples of using Mutex and add them under the existing "Std misc" chapter. Perhaps once there's enough concurrency topics they can be broken out into a "Concurrency" chapter.

@brson brson added the D-easy label Jun 27, 2016
@brson brson mentioned this issue Jul 1, 2016
@phungleson
Copy link

@bors

Concurrency is a big topic so it is a bit hard to think of where to start.

Perhaps if you have any suggestions where (books, sites, repos...) might have some ideas or patterns that are more related to rust's implementation of Mutex and Arc?

@brson
Copy link
Contributor

brson commented Jul 19, 2016

@phungleson The book chapter is a good resource. I don't have any other docs related to Rust Mutex and Arcs offhand. Maybe it does make sense to cover them together since they are so often used together.

Topics I might expect examples to cover:

  • Use Arcs to share immutable data across threads
  • Use Arcs to share Mutexed mutable data across threads
  • Use lock to get write access to interior data. Note that when the MutexGuard goes out of scope the lock is released
  • Negative example: you can't access the mutable data when the lock is released
  • When a thread panics while holding the lock is poisoned and subsequent locks will fail
  • How to get around the poisoning and take the lock anyway.

@numberMumbler
Copy link

I'll start on this if it's still available (@phungleson?)

@phungleson
Copy link

phungleson commented Jul 21, 2016 via email

@brson
Copy link
Contributor

brson commented Jul 22, 2016

Thanks @numberMumbler !

@steveklabnik
Copy link
Member

It doesn't seem like @numberMumbler is working on this; if anyone else would like to, I'd be happy to help mentor!

@hardvain
Copy link
Contributor

@steveklabnik I will write a chapter on Mutex, Rc, Arc together. I wanted to learn how rust handles this for quite sometime. Will start with this if this is still available.

@steveklabnik
Copy link
Member

Absolutely!

@marioidival
Copy link
Member

Hi, I'm closing this issue just to clean up the items that already exist. If you think this issue makes sense to stay open, please create a new issue with updated information and mention this one.

thanks!

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

No branches or pull requests

7 participants