2 ms·
Because it's simple and on the client that does not have many connections there is no point to use non-blocking just because it's the latest tech.!
by bullen 5y ago
Because it's simple and on the client that does not have many connections there is no point to use non-blocking just because it's the latest tech.!
- Jensson 5y agoNon blocking IO is ancient tech, it is done because spinning up more threads is expensive and makes performance unreliable. Thread overhead is much less of an issue today so just spinning up a new thread and running everything with blocking calls is the modern way of doing things, but many of the idioms for games are from a long time ago when not every CPU was multi core so thread switching overhead was huge and therefore they had to do non blocking IO to run well.
- bullen 5y agoSo if your client has one thread for networking why use non-blocking? The age is relative, sockets are from the 70s, non-blocking is 2000+ and in most languages it's only stable since 2010+.
- nikanj 5y agoOverlapped (=async) IO has been in Windows since NT came out, so mid-90s. I don't even know what you mean with "most languages". Most programming languages are only stable since 2010+ anyway, we get more languages every year.
- Jensson 5y ago> So if your client has one thread for networking why use non-blocking? No, the client would have one thread for everything, not one thread for networking. You shouldn't do blocking IO if you only have one thread that also needs to do other things.