def run(self): print('Thread 1 start') wtf() print('Thread 1 end')
from threading import Thread from wdb import set_trace as wtf class Thread1(Thread): def run(self): print('Thread 1 start') wtf() print('Thread 1 end') class Thread2(Thread): def run(self): print('Thread 2 start') wtf() print('Thread 2 end') t1 = Thread1() t2 = Thread2() t1.daemon = t2.daemon = True print('Starting threads') t1.start() t2.start() print('Joining') t1.join() t2.join() wtf() print('The End')
def run(self): print('Thread 2 start') wtf() print('Thread 2 end')
def run(self): print('Process 1 start') wtf() print('Process 1 end')
from wdb import set_trace as wtf class Process1(Process): def run(self): print('Process 1 start') wtf() print('Process 1 end') class Process2(Process): def run(self): print('Process 2 start') wtf() print('Process 2 end') t1 = Process1() t2 = Process2() t1.daemon = t2.daemon = True print('Forking process') t1.start() t2.start() print('Joining') t1.join() t2.join() wtf() print('The End')
def run(self): print("Process 1 start") wtf() print("Process 1 end")