4 ms·
Throw an exception to escape a syscall block sounds crazy evil. Allocate syscall I/O buffer to stack, even more so. I think they deserved this bug. Good diagno
by aetherspawn 5y ago
Throw an exception to escape a syscall block sounds crazy evil. Allocate syscall I/O buffer to stack, even more so. I think they deserved this bug.
Good diagnosis though. I think I would have given up at the kernel debugger and just refactored that entire module until it went away. I had no idea kernel debugging was even possible.
- iforgotpassword 5y ago> Allocate syscall I/O buffer to stack That part wasn't done by them though, but by select(). Still a good lesson why exceptions should only be used if you know exactly how everything that allocates any resources in between works. And sometimes you can't know until it bites your like this. On another note, getting old isn't that bad. When I saw the title I knew I read this post before but couldn't remember how it went, so the second read was just as exciting. ;)
- xfer 5y agoCrazy thing is to use alertable state, iocp doesn't work with it as you expect. I expected frameworks like unity engine to use completion ports.
- Matthias247 5y agoCompletion ports are a solution to maximize efficiency if you are dealing with thousands of connections. I don't really think unity or any other game has that requirement. It's a client, not a webserver. They probably picked the select based solution since its decently portable between windows and unix, and good enough for their requirements.
- aetherspawn 5y agoI think he is saying because Unity is expensive, he expected them at minimum to use the best technology available in the stack (IOCP), since the implementation time is fairly minimal (i.e. a developer and a few weeks) compared to the performance gained for all the games using the engine. In the same way you don't buy Unreal Engine and then expect to see GLFW being used underneath instead of the native platform APIs or something like that. You expect any big game engine to be thoroughly natively integrated, and so-be-it if they need to maintain multiple native backends. That's their value sell for an engine. And I think there would be plenty of 32-odd player games using P2P sockets.
- Matthias247 5y agoI understand that. But what performance gained? Unless your application spends 20% of CPU or more on networking or you run 1000 connections there won't be any measurable difference. Realistic numbers for games are likely < 1% of CPU, there's simply not too much data to exchange. Optimizing graphic API for games is something different, since this is really where CPU and GPU time is being spent.