Join Abhiram Ravikumar for an in-depth discussion in this video Race conditions, part of First Look: Rust.
- [Instructor] A data race is similar to a race condition…and happens when these three behaviors occur:…when two or more pointers access the same data…at the same time,…at least one of the pointers is being used…to write the data,…and when there's no mechanism being used…to synchronize access to the data.…Data races cause undefined behavior…and can be difficult to diagnose…and fix when you're trying to track them down…at run time.…Rust prevents this problem from happening…because it won't even compel the cord with data races.…
Let's do a quick demonstration…of item number three on our list.…Let's go to a command prompt,…and make a new project, and call it "race conditions."…The cd into this directory.…So once you open the race conditions directory,…we have the main.rs, where we write our source code.…Let's remove this print statement.…
Let's have a variable here, which calls a function.…Now, let's write the function, "dangle."…This function returns the reference to &String data type.…Now, let's create a String inside,…
- Installing Rust
- Data types
- Adjusting memory allocation
- Setting up race conditions
- Working with functions
- Exploring references and borrowing
- Using structs
- Method syntax
- Demonstrating recoverable errors with Result
- Working with enums
- Getting user input
Skill Level Beginner
Programming Foundations: Data Structureswith Simon Allardice2h 29m Intermediate
1. Hello, Rust!
2. Basic Programming Concepts
3. Ownership in Rust
4. Data Handling and Pattern Matching in Rust
5. Error Handling
6. Sample Rust Project: The Guessing Game
Next steps1m 14s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.