Deutsch   English   Français   Italiano  
<IO-20240202101058@ram.dialup.fu-berlin.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: Await expressions
Date: 2 Feb 2024 09:12:06 GMT
Organization: Stefan Ram
Lines: 23
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <IO-20240202101058@ram.dialup.fu-berlin.de>
References: <await-20240126193156@ram.dialup.fu-berlin.de> <await-20240201110402@ram.dialup.fu-berlin.de> <await-20240201173737@ram.dialup.fu-berlin.de> <future-20240201182111@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de EiUcNKE/Trfhc358uUqFygJ9cJ1/IvT/r9ZEeyKanLzOxH
Cancel-Lock: sha1:3fIjurOlEcJ4E0fIz7VqQOWGoWo= sha256:jn5NqFPWJW3qmJsWu9wgR3Ih2twqtlJ7gWPz6Z4k7Nc=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
	Distribution through any means other than regular usenet
	channels is forbidden. It is forbidden to publish this
	article in the Web, to change URIs of this article into links,
        and to transfer the body without this notice, but quotations
        of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
	services to mirror the article in the web. But the article may
	be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>So, this is how the control is transferred to the event
>loop after an "await sleep"! Initially, the control goes
>to "sleep", but this transfers the control to the event loop
>(until "sleep" stops waiting for its future in "await future").

  And, to answer one final question, let me quote the Web again.
  The author name is not indicated clearly, but probably it's "Bharel":

|The final burning question we must answer is - how is the IO
|implemented?
....
|The IO part of the event loop is built upon a single crucial
|function called "select".
....
|When all available tasks are waiting for futures, the event
|loop calls select and waits. When the one of the sockets has
|incoming data, or its send buffer drained up, asyncio checks
|for the future object tied to that socket, and sets it to
|done.
....
probably Bharel.