Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: cross platform alternative for signal.SIGALRM? Date: Thu, 12 Nov 2015 22:38:49 +1100 Lines: 29 Message-ID: References: <877flnu4kn.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de qEitI92K/c8bZCb70VJG/wdKsQwpqc6SjMXDgMfaKLqw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:skip:s 10': 0.05; 'correct.': 0.07; 'cc:addr:python-list': 0.09; 'abstraction': 0.09; 'loop.': 0.09; 'thu,': 0.15; '9:15': 0.16; 'async': 0.16; 'computes': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:alternative': 0.16; 'wrote:': 0.16; 'creates': 0.18; '>>>': 0.20; 'windows': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'latter': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'rest': 0.26; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; 'i/o': 0.29; 'loop,': 0.29; 'windows,': 0.29; "i'm": 0.30; 'code': 0.30; 'generally': 0.32; 'run': 0.33; 'point': 0.33; 'call,': 0.33; 'choosing': 0.33; 'right?': 0.33; 'windows.': 0.33; 'received:google.com': 0.35; 'done': 0.35; 'nov': 0.35; 'quite': 0.35; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; '12,': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'christian': 0.38; 'why': 0.39; 'sure': 0.39; 'where': 0.40; 'still': 0.40; 'chance': 0.60; 'skip:u 10': 0.61; 'back': 0.62; 'different': 0.63; 'within': 0.64; 'completion': 0.79; '"go': 0.84; 'calls,': 0.84; 'chrisa': 0.84; 'gollwitzer': 0.84; 'ultimately,': 0.84; 'different.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LiXxtypllFXCgUTjy9Xg9VdcaTzq8KRpdTNW0RCee+A=; b=iPZvi2rAgYsrEV0DgyCGAD3mvr9akNuXtmFyb++e7P4L59FEMJJ7omN6QnkF3e9NS3 lZw/md9saVqECO7bFROPl7iMj392UyqPYFfJSmx8LB0Nw4b+N9qp4xBlKnlMyE+S2e9w 50JSp3weuhd9fUd8WhiI0UaC+8DrGIdT1GWKD4XuZi/5+jAzL0s2037VaHXpcy3J05dJ avZu9pGCsH33JsAGGsxZR0y1QIb/CksC5Ow+3bObc881hx0okqgE64/WEnV65gN/Jd5F UO1QeElZcV3Xc/psMs+PNWLuTsgyn1Mg68nKXdy2GxoVGo9wRlIe48R5fcH74mw2aSKV vXfg== X-Received: by 10.50.225.38 with SMTP id rh6mr1936333igc.13.1447328330043; Thu, 12 Nov 2015 03:38:50 -0800 (PST) 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:98692 On Thu, Nov 12, 2015 at 9:15 PM, Terry Reedy wrote: > 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. I've never done that kind of thing on Windows, so I'm not sure how it works; it's still broadly based on I/O availability, right? And ultimately, it comes down to "go back to the event loop so others can run". ChrisA