Chris Angelico <ros...@gmail.com>: > On Wed, Nov 29, 2017 at 5:32 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> Don't you worry about my programs. > > Okay, but you can't claim that problems are solvable if you cheat them.
What I'm saying is that there's no particular reason why glibc couldn't offer a solution. There *is* getaddrinfo_a(), but that's suboptimal because it uses signals and (probably) a subsidiary thread. Instead, it should offer a file descriptor for the application to monitor. >> Please reread the original poster's question. It was about a blocking >> TCP listener call that another thread couldn't interrupt. > > Yet a SIGINT would successfully interrupt it. A keyboard interrupt? That your magic bullet? How does that work in practice? > Would the OP have been trivially able to send a signal to the > process? Yes. Python signal handlers are always executed in the main Python thread, even if the signal was received in another thread. This means that signals can’t be used as a means of inter-thread communication. <URL: https://docs.python.org/3/library/signal.html#signals-and-threads> Marko -- https://mail.python.org/mailman/listinfo/python-list