i try to run simple example of multiprocessing but it is not working
when i try to run the same function with threading or in regular way in working
with multiprocessing (not working):
import multiprocessing
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()
with threading (working):
import threading
def do_something():
print('Sleeping 1 second...')
time.sleep(1)
print('Done sleeping')
t1 = threading.Thread(target=do_something)
t2 = threading.Thread(target=do_something)
t1.start()
t2.start()