Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'concurrently': 0.07; 'globals': 0.09; 'received:mail-lpp01m010-f46.google.com': 0.09; '24,': 0.16; 'idea:': 0.16; 'program?': 0.16; 'shutdown.': 0.16; 'stuff.': 0.16; 'threads': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'terminate': 0.22; 'paul': 0.24; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'writes:': 0.29; 'received:209.85.215.46': 0.30; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'process,': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'modules': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'jul': 0.65; 'lose': 0.71; 'programs,': 0.71; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=IEfTMVqdmiMUib7WQbS9SMjwYv1YTNNikvdsLYp/Lik=; b=QMRxn/EG9YBJorPwpYGZ0BZFasVs/HSAdRBQKBLWQoE+XYafRUI/G+dCmK+bZBin95 ptx2CpuJZRPAFeJa7SUfzPHsceFiElOeb1Rphe1IpDMMGq4OJIAlRCeetusS5jQksAG/ x5+ZNCjz/DQ6GyR+0Yw3OhsYj2aUc0uhrUhn5F1b0DR+HiYnzifYtRijdMznr+kjUnE/ K39J2GZAfKfiRmZY0E9wyHdVPXA2ykUqrCCSyAR8gwgS4TLgiUhgP1q3RD0L+YeGJ0Fo ZCNG99sOA8PRoFzV7is57JsCZ2uJD3uM3RqENUDqUAf4O48DH3dY9OXOGiYq3AI8LTet N6+Q== MIME-Version: 1.0 In-Reply-To: <7xobn50xbj.fsf@ruckus.brouhaha.com> References: <7xobn50xbj.fsf@ruckus.brouhaha.com> From: Ian Kelly Date: Tue, 24 Jul 2012 14:08:43 -0600 Subject: Re: Daemon loses __file__ reference after a while. To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343160555 news.xs4all.nl 6927 [2001:888:2000:d::a6]:51685 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26008 On Tue, Jul 24, 2012 at 1:32 PM, Paul Rubin wrote: > Dieter Maurer writes: >> I have only one vague idea: should something try to terminate the >> process, modules would start to lose their variables during shutdown. > > That happens all the time with multi-threaded programs, because the > shutdown is happening concurrently with other threads doing stuff. Are > there threads in this particular program? It also comes up in single-threaded programs that use finalizers (__del__ methods). At the time an object is finalized, many globals might already be gone.