I use multiprocessing to set up 2 process.
Here is my code:
import multiprocessing
def aaa():
while True:
print('aaa')
def bbb():
while True:
print('bbb')
if __name__=='__main__':
p1=multiprocessing.Process(target=aaa())
p2=multiprocessing.Process(target=bbb())
p1.start
p2.start
p1.join
p2.join
I expect it will print:
'aaa','bbb','aaa','bbb','aaa','bbb','aaa','bbb','aaa','bbb','aaa','bbb',
Why does it only print aaa
, but not bbb
?
thank you!