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 09:01:40 -0500 Lines: 39 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 8L7KK2sAB876142JAHKGnAuo0k5bFMRaOorLWG95NQPA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*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; '9:15': 0.16; '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; '>>>': 0.20; 'windows': 0.20; '2015': 0.20; 'latter': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; "i've": 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'rest': 0.26; 'chris': 0.26; '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; 'done': 0.35; 'nov': 0.35; 'quite': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; '12,': 0.37; 'difference': 0.38; 'christian': 0.38; 'why': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'still': 0.40; 'chance': 0.60; 'challenge': 0.61; 'skip:u 10': 0.61; 'back': 0.62; 'more': 0.63; 'different': 0.63; 'within': 0.64; 'between': 0.65; 'covers': 0.72; 'completion': 0.79; '"go': 0.84; 'calls,': 0.84; 'gollwitzer': 0.84; 'triggering': 0.84; 'ultimately,': 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:98694 On 11/12/2015 6:38 AM, Chris Angelico wrote: > 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? That is the general abstraction. But there was something in the design discussion about a difference between 'edge' versus 'level' triggering that made it a challenge to get something more detailed that covers both implementations. > ultimately, it comes down to "go back to the event loop so others can > run". -- Terry Jan Reedy