New submission from JA:
On Ubuntu 16.04
python '3.5.1+ (default, Mar 30 2016, 22:46:26) \n[GCC 5.3.1 20160330]'
The following code prints "hi" 4 times:
import multiprocessing
import time
import threading
class dumb(threading.Thread):
def __init__(self):
super(dumb, self).__init__()
def run(self):
while True:
print("hi")
time.sleep(1)
def test():
for i in range(2):
bar = dumb()
bar.start()
def main():
p = []
for i in range(2):
p.append(multiprocessing.Process(target=test))
for i in p:
i.start()
for i in p:
i.join()
if __name__ == '__main__':
main()
Note: The above code runs fine on Python 3.5.2 (64-bit) on Windows 10
Joining the threads in test fixes the problem:
def test():
p = []
for i in range(2):
bar = dumb()
bar.start()
p.append(bar)
for i in p:
i.join()
----------
messages: 270329
nosy: JA
priority: normal
severity: normal
status: open
title: process thread with implicit join is killed unexpectedly
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27508>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com