Permutations using shared memory.