7
टास्क
Java Multithreading, स्तर 5, सबक 11
Ensuring important operations aren't interrupted
Take a look at the moveMoney() method.
If RANDOM.nextInt(5000) is greater than THRESHOLD_VALUE,
then ensure the time slice is surrendered (yield the right of way to the current thread).
Add this code to the only acceptable place.
7
टास्क
Java Multithreading, स्तर 5, सबक 11
Finagle's first law: if an experiment succeeds, then something went wrong...
Ensure the time slice is surrendered (yield the right of way to the current thread) for consistent console output.