next up previous
Next: Up: Previous:

CRCW vs. EREW

1. CREW helps when finding roots of a forest of trees.

FindRoots(F)
$\;\;\;\;\;$foreach processor i, in parallel
$\;\;\;\;\;$ $\;\;\;\;\;$if parent(i) = NIL
$\;\;\;\;\;$ $\;\;\;\;\;$then root(i) = i
$\;\;\;\;\;$while some parent(i) $\neq$ NIL
$\;\;\;\;\;$ $\;\;\;\;\;$foreach processor i, in parallel
$\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$if parent(i) $\neq$ NIL
$\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$then root(i) = root(parent(i))
$\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$ $\;\;\;\;\;$parent(i) = parent(parent(i))

Click mouse to advance to next frame.


next up previous
Next: Up: Previous: