cross platform alternative for signal.SIGALRM?

Terry Reedy tjreedy at udel.edu
Thu Nov 12 09:01:40 EST 2015


On 11/12/2015 6:38 AM, Chris Angelico wrote:
> On Thu, Nov 12, 2015 at 9:15 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> On 11/12/2015 2:37 AM, Chris Angelico wrote:
>>>
>>> On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer <auriocus at gmx.de>
>>> 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




More information about the Python-list mailing list