Signal SIGINT ignored during socket.accept

Grant Edwards invalid at invalid.invalid
Fri Sep 11 09:50:04 EDT 2015


On 2015-09-11, Chris Angelico <rosuav at 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.

> Stupid Windows.

Agreed.

[1] If offenses to engineering sensibility were of concern, then
    he wouldn't be using Windows in the first place.  ;)

-- 
Grant Edwards               grant.b.edwards        Yow! PIZZA!!
                                  at               
                              gmail.com            



More information about the Python-list mailing list