An easier option is to not use the global random generator, but instead create your own random.Random instance.