Message288594
I have this code, which sometimes hangs (1 of 5 runs):
# -*- coding: utf-8 -*-
import sys
import threading
import multiprocessing
mpl = multiprocessing.log_to_stderr()
mpl.setLevel(1)
class A(threading.Thread):
def __init__(self):
super(A, self).__init__()
def run(self):
print(self.name, 'RUN')
for line in sys.stdin: #increases probability of hanging
pass
print(self.name, 'STOP')
class B(multiprocessing.Process):
def __init__(self):
super(B, self).__init__()
def run(self):
print(self.name, 'RUN')
a = A()
a.start()
b = B()
b.start()
print('B started', b, b.is_alive(), b.pid)
print('A', a)
a.join()
b.join()
print('FINISHED')
I am running it on Ubuntu with command: echo "" | python3 time_test4.py
Output is:
Thread-1 RUN
B started <B(B-1, started)> True 31439
A <A(Thread-1, started 139779252864768)>
Thread-1 STOP |
|
Date |
User |
Action |
Args |
2017-02-26 13:48:30 | djstrong | set | recipients:
+ djstrong |
2017-02-26 13:48:30 | djstrong | set | messageid: <1488116910.28.0.662838065018.issue29658@psf.upfronthosting.co.za> |
2017-02-26 13:48:30 | djstrong | link | issue29658 messages |
2017-02-26 13:48:29 | djstrong | create | |
|