Ejemplo n.º 1
0
 def run(self):
     print('Thread 1 start')
     wtf()
     print('Thread 1 end')
Ejemplo n.º 2
0
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')
Ejemplo n.º 3
0
 def run(self):
     print('Thread 2 start')
     wtf()
     print('Thread 2 end')
Ejemplo n.º 4
0
 def run(self):
     print('Process 1 start')
     wtf()
     print('Process 1 end')
Ejemplo n.º 5
0
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')
Ejemplo n.º 6
0
 def run(self):
     print("Process 1 start")
     wtf()
     print("Process 1 end")
Ejemplo n.º 7
0
 def run(self):
     print('Thread 1 start')
     wtf()
     print('Thread 1 end')
Ejemplo n.º 8
0
 def run(self):
     print('Thread 2 start')
     wtf()
     print('Thread 2 end')