Skip to content

Add cargo instructions for dinning_philosophers project #30038

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

Merged
merged 1 commit into from
Nov 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/doc/book/dining-philosophers.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ Now, let’s imagine this sequence of events:
6. ... ? All the forks are taken, but nobody can eat!

There are different ways to solve this problem. We’ll get to our solution in
the tutorial itself. For now, let’s get started modeling the problem itself.
We’ll start with the philosophers:
the tutorial itself. For now, let’s get started and create a new project with
`cargo`:

```bash
$ cd ~/projects
$ cargo new dining_philosophers --bin
$ cd dining_philosophers
```

Now we can start modeling the problem itself. We’ll start with the philosophers
in `src/main.rs`:

```rust
struct Philosopher {
Expand Down