Difference between revisions of "Race Conditions Studio"
Jump to navigation
Jump to search
Benjaminchoi (talk | contribs) |
|||
(20 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | =Motivation= | ||
+ | Race conditions can lead to difficult bugs to find and fix. We gain experience finding them and fixing them. | ||
+ | |||
=Background= | =Background= | ||
+ | In this studio, you will take in a collection of strings, clean up each string, and add it into another collection of strings concurrently. | ||
− | + | =The Core Questions= | |
− | + | Really think about these questions in each case. Knowing the answers to these will tell you where the problem is. | |
− | + | *What are the tasks? | |
− | + | *What is the data? | |
− | + | *Is the data mutable? | |
− | + | *If so, how is it shared? | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | =Code To Debug= | |
+ | ==Word Score== | ||
+ | {{CodeToDebug|SuspectWordScore|toCleanedWordsViaArray|racecondition.wordscore.studio}} | ||
+ | {{Parallel|public static List<String> toCleanedWordsViaArray(Collection<String> sourceLines)}} | ||
− | == | + | =Testing Your Solution= |
+ | ==Correctness== | ||
+ | {{TestSuite|WordScoreTestSuite|acecondition.wordscore.studio}} | ||
− | + | =Pledge, Acknowledgments, Citations= | |
+ | {{Pledge|studio-race-condition-word-score}} |
Latest revision as of 16:36, 23 January 2020
Contents
Motivation
Race conditions can lead to difficult bugs to find and fix. We gain experience finding them and fixing them.
Background
In this studio, you will take in a collection of strings, clean up each string, and add it into another collection of strings concurrently.
The Core Questions
Really think about these questions in each case. Knowing the answers to these will tell you where the problem is.
- What are the tasks?
- What is the data?
- Is the data mutable?
- If so, how is it shared?
Code To Debug
Word Score
class: | SuspectWordScore.java | |
methods: | toCleanedWordsViaArray | |
package: | racecondition.wordscore.studio | |
source folder: | student/src/main/java |
method: public static List<String> toCleanedWordsViaArray(Collection<String> sourceLines)
(parallel implementation required)
Testing Your Solution
Correctness
class: | WordScoreTestSuite.java | |
package: | acecondition.wordscore.studio | |
source folder: | testing/src/test/java |
Pledge, Acknowledgments, Citations
file: | studio-race-condition-word-score-pledge-acknowledgments-citations.txt |
More info about the Honor Pledge