add some multiprocess and race condition examples

This commit is contained in:
Mia von Steinkirch 2020-03-04 10:12:53 -08:00
parent 5224dc91ca
commit be98abd3b5
4 changed files with 57 additions and 4 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import multiprocessing
import logging
import sys
def worker():
print 'Doing some work'
sys.stdout.flush()
if __name__ == '__main__':
multiprocessing.log_to_stderr(logging.DEBUG)
p = multiprocessing.Process(target=worker)
p.start()
p.join()