How to shut down a TCPServer serve_forever() loop?

Marko Rauhamaa marko at pacujo.net
Tue Nov 28 13:32:45 EST 2017


Chris Angelico <rosuav at gmail.com>:

> On Wed, Nov 29, 2017 at 5:03 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Chris Angelico <rosuav at gmail.com>:
>>> Do you respect /etc/nsswitch.conf?
>>
>> No, but I don't need to.
>
> Ah, right. Until the day you're wrestling with "why doesn't /etc/hosts
> apply to this program". Yep, you totally don't need nsswitch.

Don't you worry about my programs.

>> In this discussion I was referring to the fact that you can interrupt
>> a coroutine while that is generally not possible to do to a blocking
>> thread.
>
> I'm not sure what you mean by a "blocking thread". Whether it's a
> coroutine or not, you can't interrupt gethostbyname(); and whether
> it's a coroutine or not, you CAN interrupt any syscall that responds
> to signals (that's the whole point of EINTR).

Please reread the original poster's question. It was about a blocking
TCP listener call that another thread couldn't interrupt.


Marko



More information about the Python-list mailing list