Skip to content

Commit

Permalink
Operating_Systems: Fixed final sum in case of race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
strongX509 committed Aug 30, 2021
1 parent 27ecf33 commit 5a74428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Operating_Systems/Multi-Threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ We notice that each thread has its own stack area.

## Spinlocks <a name="section2"></a>

If we execute the `multithreads` program several times, it sometimes happens that the final value of the `inc` variable in the last thread to rejoin the main program is not `30000` but `299999` or even `29998` as shown in the run below:
If we execute the `multithreads` program several times, it sometimes happens that the final value of the `inc` variable in the last thread to rejoin the main program is not `30000` but `29999` or even `29998` as shown in the run below:
```console
> ./multithreads
...
Expand Down

0 comments on commit 5a74428

Please sign in to comment.