Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96343
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Marko Rauhamaa <marko@pacujo.net> |
| Newsgroups | comp.lang.python |
| Subject | Re: Signal SIGINT ignored during socket.accept |
| Date | Fri, 11 Sep 2015 17:00:30 +0300 |
| Organization | A noiseless patient Spider |
| Lines | 29 |
| Message-ID | <87k2rxqcn5.fsf@elektro.pacujo.net> (permalink) |
| References | <msshpm$7pn$1@dont-email.me> <mailman.332.1441910212.8327.python-list@python.org> <msskh1$j00$1@dont-email.me> <mailman.337.1441913195.8327.python-list@python.org> <msso49$28e$1@dont-email.me> <mailman.348.1441936893.8327.python-list@python.org> <msum6c$hv$1@reader1.panix.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="6297"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TQb6xBeKh8sQ9cFZSxgeH" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
| Cancel-Lock | sha1:MpeQI17DlzGa8vlHSldWIC/nVOY= sha1:5K1MmxW2jBZ6HuLfeFL7ibHkuj4= |
| Xref | csiph.com comp.lang.python:96343 |
Show key headers only | View raw
Grant Edwards <invalid@invalid.invalid>: > On 2015-09-11, Chris Angelico <rosuav@gmail.com> wrote: >> This is what I meant when I said you would be polling. Effectively, >> you wake up your program every half-second, check if Ctrl-C has been >> pressed, and if it hasn't, you go back to sleep again. This is pretty >> inefficient. > > Though it offends one's engineering sensibilities[1], it's just not > that inefficient. I'd bet money you won't even be able to measure the > difference in CPU usage. Waking up twice per second and immediately > calling select() again on any hardware/OS built in the past 50 years > is going completely negligible (as long as you can ignore the smell). > > Even waking up ten times per second won't be noticeable. > > Waking up every millisecond or two might be noticeable. It can add up. In particular, it can prevent the CPU from staying in the low-power mode, especially on battery-powered devices. <URL: https://lwn.net/Articles/549580/> Another environment where such polling circuses can actually overwhelm a CPU is virtual machines. When dozens or hundreds of VMs are each polling left and right, the host may not get much actual work done. Marko
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Signal SIGINT ignored during socket.accept "James Harris" <james.harris.1@gmail.com> - 2015-09-10 19:24 +0100
Re: Signal SIGINT ignored during socket.accept Chris Angelico <rosuav@gmail.com> - 2015-09-11 04:36 +1000
Re: Signal SIGINT ignored during socket.accept "James Harris" <james.harris.1@gmail.com> - 2015-09-10 20:11 +0100
Re: Signal SIGINT ignored during socket.accept Chris Angelico <rosuav@gmail.com> - 2015-09-11 05:26 +1000
Re: Signal SIGINT ignored during socket.accept "James Harris" <james.harris.1@gmail.com> - 2015-09-10 21:12 +0100
Re: Signal SIGINT ignored during socket.accept Chris Angelico <rosuav@gmail.com> - 2015-09-11 12:01 +1000
Re: Signal SIGINT ignored during socket.accept Grant Edwards <invalid@invalid.invalid> - 2015-09-11 13:50 +0000
Re: Signal SIGINT ignored during socket.accept Marko Rauhamaa <marko@pacujo.net> - 2015-09-11 17:00 +0300
Re: Signal SIGINT ignored during socket.accept Chris Angelico <rosuav@gmail.com> - 2015-09-12 00:27 +1000
Re: Signal SIGINT ignored during socket.accept "James Harris" <james.harris.1@gmail.com> - 2015-09-11 18:14 +0100
Re: Signal SIGINT ignored during socket.accept "James Harris" <james.harris.1@gmail.com> - 2015-09-12 00:15 +0100
csiph-web