On 2026-10-30, Lawrence D’Oliveiro <l…@nz.invalid> wrote:
> Threading is still definitely useful, mainly for performance, where > the bottleneck is in CPU usage. But if a program is spending most of > its time waiting for I/O over the network, or for a user to initiate a > GUI action, or something external and relatively slow like that, then > coroutines keep things simpler.
I've always tried to avoid the complexities of threading; in most cases I can get away with round-robin scheduling. But I found that some servers are very slow to respond, and even when trying to do a non-blocking setup of a TCP/IP connection, the connect() API would unavoidably block. I had to spin that part off into its own thread to keep the rest of the program (including other connections) from hanging.
-- /~\ Charlie Gibbs | In this world there are \ / <cgib…@kltpzyxm.invalid> | two kinds of people: X I'm really at ac.dekanfrus | 1. Those who can extrapolate / \ if you read it the right way. | from incomplete data.