Jade/data race #6
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes changes to set up a new Rust project for handling data races, including configuration files, a Makefile, and a main Rust source file. The most important changes are the addition of the
Cargo.tomlfile, theMakefile, and the implementation of a simple multithreaded program using a mutex.Project setup:
module2/data_race/Cargo.toml: Added the package configuration for the new Rust project, specifying the package name, version, edition, and dependencies.Build and management:
module2/data_race/Makefile: Added a Makefile with targets for common development tasks such as building, running, testing, linting, formatting, and releasing the project. It also includes a target for bumping the project version.Multithreading implementation:
module2/data_race/src/main.rs: Implemented a simple program that demonstrates the use of a mutex to protect shared data across multiple threads. The program spawns three threads, each modifying an element of a vector, and includes a commented-out section explaining why a similar approach without a mutex would fail to compile due to the borrow checker.