Oblivious algorithms for multicores and networks of processors