Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103475
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: [Python-ideas] How the heck does async/await work in Python 3.5 |
| Date | Wed, 24 Feb 2016 20:37:38 -0500 |
| Organization | IISS Elusive Unicorn |
| Lines | 39 |
| Message-ID | <mailman.114.1456364263.20994.python-list@python.org> (permalink) |
| References | <mailman.224.1455746935.22075.python-list@python.org> <56c7d145$0$1597$c3e8da3$5496439d@news.astraweb.com> <na92c0$n65$1@dont-email.me> <56CCC98C.5060504@mail.de> <mailman.90.1456310533.20994.python-list@python.org> <dj6jvfFd8sdU1@mid.individual.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de F5b0HKkPhFMaNEl0mxCx9A02bMCaS+5YMwwal79Ovdqw== |
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'subject:Python': 0.05; 'url:msdn': 0.07; 'subject:How': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'similar,': 0.09; 'python': 0.10; 'exception': 0.13; 'thu,': 0.15; '(well,': 0.16; '2016': 0.16; 'amiga': 0.16; 'different,': 0.16; 'gregory': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'seconds,': 0.16; 'subject:ideas': 0.16; 'url:85)': 0.16; 'wrote:': 0.16; 'url:home': 0.18; 'subject:] ': 0.19; 'windows': 0.20; 'suppose': 0.22; 'feb': 0.23; 'words': 0.24; 'header:X -Complaints-To:1': 0.26; 'looks': 0.29; 'block,': 0.29; 'i/o': 0.29; 'url:wikipedia': 0.29; "i'm": 0.30; 'print': 0.30; 'subject:/': 0.30; 'url:wiki': 0.30; 'seconds': 0.31; 'supposed': 0.31; 'probably': 0.31; 'common': 0.33; 'flags': 0.33; 'channel': 0.34; 'could': 0.35; 'skip:> 10': 0.35; 'something': 0.35; 'but': 0.36; 'too': 0.36; 'url:org': 0.36; '(and': 0.36; 'mode': 0.36; 'subject:work': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'itself': 0.38; 'skip:p 20': 0.38; 'url:en': 0.39; 'subject:the': 0.39; 'takes': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'future': 0.60; 'close': 0.61; 'skip:u 10': 0.61; 'real': 0.62; 'fire': 0.63; 'believe': 0.66; 'rare': 0.66; 'url:%28': 0.66; 'url:%29': 0.66; 'url:%1': 0.67; 'url:en-us': 0.72; 'treats': 0.84; 'dennis': 0.91; 'received:108': 0.93 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| X-Gmane-NNTP-Posting-Host | adsl-108-73-119-73.dsl.klmzmi.sbcglobal.net |
| X-Newsreader | Forte Agent 6.00/32.1186 |
| X-No-Archive | YES |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21rc2 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:103475 |
Show key headers only | View raw
On Thu, 25 Feb 2016 10:00:29 +1300, Gregory Ewing
<greg.ewing@canterbury.ac.nz> declaimed the following:
>?? wrote:
>> Suppose io_operation() takes 3 seconds, then how can I write something like
>>
>> future = io_operation()
>> print('Start')
>> time.sleep(1)
>> print('Something')
>> time.sleep(2)
>> print(future.result())
>>
>> that print 'Start' immediately and the result of io_operation() 3 seconds
>> later.
>
>Yes, Python can do this, but you probably need to use real
>threads. The only exception would be if io_operation() were
>something you could fire off with a single system call that's
>guaranteed not to block, and then wait for the result later.
>Opportunities for things like that are rare in unix.
>(Windows might be different, I'm not sure.)
>
But was common under VMS
https://en.wikipedia.org/wiki/QIO
I believe Windows is supposed to be similar, but QIO status words and
event flags were understandable to me (and close match to AmigaOS too <G>);
Windows somehow treats the I/O channel itself as the waitable object (well,
looks like one embeds it into the I/O call -- but has to create the channel
in "overlapped" mode where VMS differentiated on the I/O call itself: QIO
vs QIOW; Amiga differentiated with DoIO and SendIO)
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686358%28v=vs.85%29.aspx
http://wiki.amigaos.net/wiki/Exec_Device_I/O#Synchronous_vs._Asynchronous_Requests
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How the heck does async/await work in Python 3.5 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-02-17 22:08 +0000
Re: How the heck does async/await work in Python 3.5 Steven D'Aprano <steve@pearwood.info> - 2016-02-20 13:36 +1100
Re: How the heck does async/await work in Python 3.5 Rustom Mody <rustompmody@gmail.com> - 2016-02-19 21:24 -0800
Re: How the heck does async/await work in Python 3.5 Rustom Mody <rustompmody@gmail.com> - 2016-02-19 21:34 -0800
Re: How the heck does async/await work in Python 3.5 Paul Rubin <no.email@nospam.invalid> - 2016-02-19 22:44 -0800
Re: How the heck does async/await work in Python 3.5 Steven D'Aprano <steve@pearwood.info> - 2016-02-21 18:17 +1100
Re: How the heck does async/await work in Python 3.5 Paul Rubin <no.email@nospam.invalid> - 2016-02-20 23:34 -0800
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-20 00:48 -0700
Re: How the heck does async/await work in Python 3.5 Chris Angelico <rosuav@gmail.com> - 2016-02-20 18:57 +1100
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-20 01:14 -0700
Re: How the heck does async/await work in Python 3.5 Chris Angelico <rosuav@gmail.com> - 2016-02-20 19:49 +1100
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-20 02:11 -0700
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-20 02:21 -0700
Re: How the heck does async/await work in Python 3.5 Christian Gollwitzer <auriocus@gmx.de> - 2016-02-20 07:53 +0100
Re: How the heck does async/await work in Python 3.5 "Sven R. Kunze" <srkunze@mail.de> - 2016-02-22 23:16 +0100
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-22 17:48 -0700
Re: How the heck does async/await work in Python 3.5 "Sven R. Kunze" <srkunze@mail.de> - 2016-02-23 17:50 +0100
Re: How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-23 10:37 -0700
Re: How the heck does async/await work in Python 3.5 "Sven R. Kunze" <srkunze@mail.de> - 2016-02-23 20:42 +0100
Re: How the heck does async/await work in Python 3.5 "Sven R. Kunze" <srkunze@mail.de> - 2016-02-23 22:05 +0100
Re: [Python-ideas] How the heck does async/await work in Python 3.5 "Joao S. O. Bueno" <jsbueno@python.org.br> - 2016-02-23 18:25 -0300
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Paul Moore <p.f.moore@gmail.com> - 2016-02-24 09:59 +0000
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Victor Stinner <victor.stinner@gmail.com> - 2016-02-24 11:01 +0100
Re: [Python-ideas] How the heck does async/await work in Python 3.5 王珺 <wjun77@gmail.com> - 2016-02-24 18:40 +0800
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-02-25 10:00 +1300
Re: [Python-ideas] How the heck does async/await work in Python 3.5 王珺 <wjun77@gmail.com> - 2016-02-25 08:40 +0800
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-02-24 20:37 -0500
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Tem Pl <rtempl31@gmail.com> - 2016-02-24 06:39 -0800
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Marko Rauhamaa <marko@pacujo.net> - 2016-02-24 17:23 +0200
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-24 08:41 -0700
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Marko Rauhamaa <marko@pacujo.net> - 2016-02-24 18:13 +0200
Re: [Python-ideas] How the heck does async/await work in Python 3.5 Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-24 09:47 -0700
csiph-web