New submission from Vadim Tsozik <tso...@yahoo.com>:

Attached is code sample that forks child process either from main or from 
background thread. Child starts and joins all of its threads except a sleeping 
daemon. If parent forks child from main thread program exits immediately after 
child threads are joined and waitpid is unblocked by SIGCHLD. However if parent 
process happens to fork from main thread everything works correctly and process 
exits immediately without waiting for daemon to sleep for 3600 seconds. I'm 
wondering what is the difference between main and background thread in parent. 
Only one thread survives forking in child and becomes main thread in the child, 
so there should be no differences in the behavior.

Thank you in advance for your help,

----------
components: Build
files: threadforkmodel.py
messages: 334886
nosy: vtsozik
priority: normal
severity: normal
status: open
title: Forking from background thread
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48103/threadforkmodel.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to