Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'context': 0.07; 'subject:help': 0.08; 'performs': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'uses.': 0.09; 'thread': 0.14; '"every': 0.16; 'check.': 0.16; 'handler,': 0.16; 'invocation': 0.16; 'otoh,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'switch.': 0.16; 'underlying': 0.16; 'url:home': 0.24; 'mon,': 0.24; 'header:X-Complaints-To:1': 0.27; 'chris': 0.29; '(which': 0.31; 'checked': 0.32; 'another': 0.32; 'subject:with': 0.35; 'something': 0.35; 'case,': 0.35; 'raising': 0.36; 'charset:us-ascii': 0.36; 'being': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'explain': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'signal': 0.60; 'spot': 0.65; 'obvious': 0.74; 'interrupt': 0.84; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Please help with Threading Date: Sun, 19 May 2013 22:58:45 -0400 Organization: > Bestiaria Support Staff < References: <7baacf5a-0c50-4935-ad5b-148c208d759b@googlegroups.com> <13lfp8lds6e2e41rtsnvqimcb6inu7p28o@invalid.netcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-222-109.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369018731 news.xs4all.nl 15892 [2001:888:2000:d::a6]:56094 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45580 On Mon, 20 May 2013 07:52:23 +1000, Chris Angelico declaimed the following in gmane.comp.python.general: > Incidentally, is the context-switch check the same as the check for > interrupt signal raising KeyboardInterrupt? ISTR that was another > "every N instructions" check. > That I couldn't say -- it would be the obvious spot for the interpreter to check some global flag, said flag perhaps being set by an interrupt handler, signal bits, or whatever the underlying OS uses. OTOH, KeyboardInterrupt may be something passed up through the I/O system and only checked when a thread performs I/O on stdin (which would explain how number crunchers can be "unstoppable"). And in this case, the invocation of the I/O triggers a context switch. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/