Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: cross platform alternative for signal.SIGALRM? Date: Thu, 12 Nov 2015 05:15:52 -0500 Lines: 19 Message-ID: References: <877flnu4kn.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de s5ZsRqb7UO54a3xJuecibAnIv77XkX95BnGNz65q77Vg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:skip:s 10': 0.05; 'correct.': 0.07; 'abstraction': 0.09; 'loop.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.11; 'thu,': 0.15; 'async': 0.16; 'computes': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:alternative': 0.16; 'wrote:': 0.16; 'creates': 0.18; 'windows': 0.20; '2015': 0.20; 'latter': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'rest': 0.26; 'chris': 0.26; 'loop,': 0.29; 'code': 0.30; 'generally': 0.32; 'run': 0.33; 'point': 0.33; 'call,': 0.33; 'choosing': 0.33; 'windows.': 0.33; 'nov': 0.35; 'quite': 0.35; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; '12,': 0.37; 'christian': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'chance': 0.60; 'skip:u 10': 0.61; 'different': 0.63; 'within': 0.64; 'completion': 0.79; 'calls,': 0.84; 'gollwitzer': 0.84; 'different.': 0.91; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-173-59-124-74.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98690 On 11/12/2015 2:37 AM, Chris Angelico wrote: > On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer wrote: >> My understanding of async is that it creates an event loop. In which case >> the loop has no chance to run within a block of code that computes anything, >> is that correct? > > This is correct. At its simplest, asynchronous code is an abstraction > over the select() call, True on Unix-derived systems, where 'select' includes the various derivatives. It is also an abstraction over the Windows completion calls, which are quite different. The latter is why one must generally use a different event loop on Windows. The point is that asyncio provides an *abstraction* such that after choosing the event loop, the rest of one's code is os-agnostic. -- Terry Jan Reedy