Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code Samples for os.nice post
import os
...
def thread_mask(args):
# Properly Parallel RNG
#http://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python
myid=current_process()._identity[0]
np.random.seed(myid^struct.unpack("<L",os.urandom(4))[0])
os.nice(5)
return long_simulation(args)
...
# Be Nice
niceness=os.nice(0)
os.nice(5-niceness)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.