Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Status of side-effecting functions in python Date: Tue, 28 Oct 2014 11:07:14 +0200 Organization: A noiseless patient Spider Lines: 23 Message-ID: <87y4s0tvel.fsf@elektro.pacujo.net> References: <438d510f-05ae-47dd-bcda-42a8b777c99b@googlegroups.com> <683c84d8-d916-4b63-b4b2-92cd2763e260@googlegroups.com> <544e2cf2$0$13009$c3e8da3$5496439d@news.astraweb.com> <87bnoxv91p.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="32476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uJzI7zMNSA7i1Jno64h3l" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:nE7LbNIw4wp6izUBT3O583amUKM= sha1:0IqLMKWjGYBT+Rppgedyu9gjetE= Xref: csiph.com comp.lang.python:79830 Nobody : > Asynchronous I/O in the sense of select(), poll(), O_NONBLOCK etc is > meant for situations where delays could be indefinite, e.g. network > connections or terminals. For "short" delays (i.e. disc access), > there's not much point having a mechanism so that you can avoid > blocking while the data is read from disc just so that you can block > while the code in the "else" branch is read from disc. I disagree with the "shortness" of the delays. > If you want the program to be able to do something else while waiting > for I/O, use threads. The introduction of threads made most > concurrency- related issues in the POSIX API moot. I disagree about that point of view as well. If files played ball with select() et al, the linux world would be a better, more coherent place. For example, looking at Python3's asyncio, I don't want to go out of the asyncio model just because of disk (or DB) access. Marko