I was teaching myself about multiptocessing in Python on Spyder and was working through some relatively simple examples when it suddenly stopped working. Going back to some simpler examples that had previously worked they now seemed to be not working as well. I can't think what I could have done to make them stop working. Below is my code:
import time
import multiprocessing
start = time.perf_counter()
def do_something():
print('Sleeping 1 second...')
time.sleep(1)
print('Done Sleeping...')
p1 = multiprocessing.Process(target = do_something)
p2 = multiprocessing.Process(target = do_something)
p1.start()
p2.start()
p1.join()
p2.join()
finish = time.perf_counter()
print(f'Finished in {round(finish - start, 2)} second(s)')
It just seems to run as if the middle part:
p1 = multiprocessing.Process(target = do_something)
p2 = multiprocessing.Process(target = do_something)
p1.start()
p2.start()
p1.join()
p2.join()
Is not there?
edit
The only output was
Finished in 0.64 second(s)
with no error message.