Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by jacquesm on Saturday January 06, 2018 @07:56AM
(#16085085)
That only works if messages are independent of answers received and are all known at the same point in time. In most games this typically would not be the case, you'd use a message to cram as much state change into it as is known to keep the game moving fluidly. Packing more than one such message together would serve no purpose.
[ Parent
| on HN ]
Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by _wmd on Saturday January 06, 2018 @08:53AM
(#16085232)
I'd have presumed otherwise, but I'm not sure if you're understanding the API correctly.. it's not about sending multiple messages to the same destination, but to multiple destinations in a single call. The msg_hdr struct has room for specifying the target address.
From userspace' perspective, even if the same data isn't being broadcast at every client, just building up a big array (perhaps while looping over the input from recvmmsg()!) and spitting it out once would have the same semantics as just calling sendmsg() immediately on each, etc
Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by jacquesm on Saturday January 06, 2018 @09:01AM
(#16085265)
Yes, I understand the API correctly. Having implemented it once I think I have the basics down ;) But that said I was assuming that this would be in the context of multiple UDP messages sent from a game client to a game server.
Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by Doxin on Friday January 12, 2018 @09:40AM
(#16133087)
The bottleneck generally isn't at the client side for games, The server has much more network traffic to handle. So even if this performance fix only works server-side that might be enough.
Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by EgoIncarnate on Saturday January 06, 2018 @01:37PM
(#16086725)
It's pretty common for FPS server game loops to read all the network packets, update player state, run one tick of game logic and physics for all users in a single game, and then send out updates to everyone.
Re:CPU Usage Differences After Applying Meltdown Patch at Ep...
by vvanders on Saturday January 06, 2018 @03:38PM
(#16087317)
Yup, this is pretty much on the mark. Game updates are sent at a fixed rate(usually 10-20Hz) so you could batch up all outgoing game state into a single dispatch. It'd probably take a bit of work re-architect the output loop(pre-allocate for max number of players to avoid per-frame allocations) but should be reasonably straightforward to implement in most engines.