Files
pplus-library/pseudo/programs/44-parallel-race.pseudo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

11 lines
255 B
Plaintext

// 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