Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.054 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; '(except': 0.07; 'method,': 0.09; 'thread': 0.14; 'expert,': 0.16; 'hierarchy': 0.16; 'thread,': 0.16; 'wrote:': 0.18; 'slightly': 0.19; 'case.': 0.24; 'skip': 0.24; 'suggested': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'running': 0.33; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'two': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'more': 0.64; 'equals': 0.68; 'jul': 0.74; 'interrupt': 0.84; 'interrupted': 0.96 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=Mctt+iAI6oIQnVvV+jKw5aRRUX4dAV3VzT/ZT3Go+Pk=; b=Z0DHBpWx5wO0kn/0UUCcbuHM4OgOyTL5Ltq0ef9OKJxx4Lswkv1n9XS9TCLGJL6/a9 NOVir1OSBjLOCqRtb4buqrMLZAWq0dGf09ZKr9geS7BqyeVIdlYa7xNE/76PDXsLrg0J cVdn3FrnA58Rfu2FLcSUeun7H3MP//Upgkxm4CiQJKHkhI1rSfIMOCLupna3n9JKsXpb 0IZm3R++5SsWveV6QKHH/f1OpKkGQaM9B06qO+yeFlu7XLS6QiqOTkomscWIOs2iBdQI /u6ao3CFc1ZCsFBkfM31eCRLOi1B2QGroohNxoStafcSO+bb+LYfrBwzun+i4R3VD6M7 A+XA== X-Received: by 10.69.31.107 with SMTP id kl11mr63101126pbd.70.1404236869845; Tue, 01 Jul 2014 10:47:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Tue, 1 Jul 2014 11:47:09 -0600 Subject: Re: thread.interrupt_main() behaviour To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 1404236879 news.xs4all.nl 2887 [2001:888:2000:d::a6]:52201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73799 On Tue, Jul 1, 2014 at 3:45 AM, Skip Montanaro wrote: > On Tue, Jul 1, 2014 at 3:58 AM, Piyush Verma <114piyush@gmail.com> wrote: >> >> Since two threads are running same method, I wanted to know which main thread will be interrupted in both case. > > I'm no threading expert, but a process can only have one main thread, > the one you labeled "P". Threads T2 and Tt2 will both interrupt that > thread. Also, the threading model has no hierarchy as suggested by the diagram. All threads are equals (except the main thread, which is slightly more equal than others).