Baseline: tree as shared

This commit is contained in:
alexm committed 2026-10-05 03:03:38 +00:00
commit 31f2fb8a5a
1679 files changed
+1024562

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
// A shared running total inside a PARALLEL FOR is a data race, and the lab says so.
// STOPS: race
DECLARE Xs : LIST OF FLOAT
DECLARE Acc : FLOAT
Xs <- [1.0, 2.0, 3.0]
Acc <- 0.0
PARALLEL FOR I <- 0 TO LENGTH(Xs)
Acc <- Acc + Xs[I]
NEXT I
OUTPUT Acc