I am getting started with multiprocessing and tried to do a simple code using Process, however the result is different from Colab and my local pc. It seem on my pc (using Windows and Jupyter lab via Anaconda) the process doesn't start. The code is:
from multiprocessing import Process
def teste(a):
print(a)
if __name__ == '__main__':
print('ok')
p = Process(target=teste, args=(1,))
p.start()
p.join()
print('b')
print(p)
The result when running on Colab is:
"ok
1
b
Process name='Process-10' pid=3765 parent=493 stopped exitcode=0>"
However if I run on my PC is:
"ok
b
Process name='Process-10' pid=27844 parent=10844 stopped exitcode=0>"
It seems the comand p.start() is not working. What can it be?