The example performs two parallel loops: an outer loop over
inner loop over
. The creation of the isolated
protects the inner loop from downwards
propagation of cancellation from the
loop. When the exception
propagates to the outer loop, any pending
cancelled, but not inner iterations for an outer iteration that started.
Hence when the program completes, each row of
may be different,
depending upon whether its iteration
ran at all, but within a row,
the elements will be homogeneously
, not a mixture.