Re:Debugging memory corruption: who the hell writes “2” into...
by Jensson on Sunday November 14, 2021 @06:05AM
(#29216547)
Non 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.
[ Parent
| on HN ]
Re:Debugging memory corruption: who the hell writes “2” into...
by bullen on Sunday November 14, 2021 @06:25AM
(#29216624)
So 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+.
Re:Debugging memory corruption: who the hell writes “2” into...
by nikanj on Sunday November 14, 2021 @07:07AM
(#29216752)
Overlapped (=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.
Re:Debugging memory corruption: who the hell writes “2” into...
by Jensson on Sunday November 14, 2021 @04:34PM
(#29220954)
> 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.