Per-thread randomness, part 2

(This time it actually works)