[New-bugs-announce] [issue35902] Forking from background thread

Vadim Tsozik report at bugs.python.org
Tue Feb 5 17:17:51 EST 2019


New submission from Vadim Tsozik <tsozik at 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 <report at bugs.python.org>
<https://bugs.python.org/issue35902>
_______________________________________


More information about the New-bugs-announce mailing list