Simple TCP proxy

Chris Angelico rosuav at gmail.com
Thu Jul 28 05:43:02 EDT 2022


On Thu, 28 Jul 2022 at 19:41, Morten W. Petersen <morphex at gmail.com> wrote:
>
> Hi Martin.
>
> I was thinking of doing something with the handle function, but just this
> little tweak:
>
> https://github.com/morphex/stp/commit/9910ca8c80e9d150222b680a4967e53f0457b465
>
> made a huge difference in CPU usage.  Hundreds of waiting sockets are now
> using 20-30% of CPU instead of 10x that.

.... wait, what?

Why do waiting sockets consume *any* measurable amount of CPU? Why
don't the threads simply block until it's time to do something?

ChrisA


More information about the Python-list mailing list