Re: [ioquake3] Fair ping

2011-05-14 Thread Ismael Garrido
I attach my implementation of a fair-ping server. The admin sets sv_packetdelay and that makes the server try to get everyone on at least that ping. It does so by delaying the sending of packets. Every packet that is to be sent is put on a queue. The packets get sent by a thread that runs regular

Re: [ioquake3] Fair ping

2011-01-24 Thread Thilo Schulz
On Saturday, 22. January 2011 17:22:44 Ismael Garrido wrote: > I don't see how to send the packets out in accurate enough timing > without threads. As far as I tested, currently FlushPacketQueue is > called in irregular intervals. That's why one uses the select() syscall for asynchronous I/O. > S

Re: [ioquake3] Fair ping

2011-01-22 Thread Ismael Garrido
On Sat, Jan 22, 2011 at 1:32 AM, Thilo Schulz wrote: > On Friday, 21. January 2011 17:34:33 Ismael Garrido wrote: >> I tried making a separate thread >> which called NET_FlushPacketQueue every 1 us and it still was jittery. > > Don't. You want to avoid threads whenever possible. Let me begin by s

Re: [ioquake3] Fair ping

2011-01-21 Thread Michael Menegakis
On Sat, Jan 22, 2011 at 5:58 AM, Thilo Schulz wrote: > On Saturday, 22. January 2011 04:43:37 eviljoel wrote: >> Are you saying this to avoid complex programming > > Precisely. And basically threading is an overkill if one just needs a tiny subsystem that updates a couple of variables. Complexity

Re: [ioquake3] Fair ping

2011-01-21 Thread eviljoel
Yeah, and I guess ioquake3 isn't exactly pushing the boundaries of a single thread on any architecture that will have multiple cores. - ej On Fri, Jan 21, 2011 at 9:58 PM, Thilo Schulz wrote: > On Saturday, 22. January 2011 04:43:37 eviljoel wrote: >> Are you saying this to avoid complex progra

Re: [ioquake3] Fair ping

2011-01-21 Thread Thilo Schulz
On Saturday, 22. January 2011 04:43:37 eviljoel wrote: > Are you saying this to avoid complex programming Precisely. > I believe contemporary thinking is to split each > tick into as many threads as possible. Maybe for highly parallel applications with huge throughput of data, like movie encodi

Re: [ioquake3] Fair ping

2011-01-21 Thread eviljoel
Hey Thilo, > Don't. You want to avoid threads whenever possible. Are you saying this to avoid complex programming or is there more background on this? I believe contemporary thinking is to split each tick into as many threads as possible. Thanks, ej On Fri, Jan 21, 2011 at 9:32 PM, Thilo Schu

Re: [ioquake3] Fair ping

2011-01-21 Thread Thilo Schulz
On Friday, 21. January 2011 17:34:33 Ismael Garrido wrote: > Looking at the sv_packetdelay variable, it occurred to me that it > could be possible to make a "fair ping" server That's a very interesting idea. > I tried making a separate thread > which called NET_FlushPacketQueue every 1 us and it

[ioquake3] Fair ping

2011-01-21 Thread Ismael Garrido
Looking at the sv_packetdelay variable, it occurred to me that it could be possible to make a "fair ping" server, ie: one where every player has the same ping, or at least "more than x ping". This could be useful for leagues, to avoid having ping advantages for some players. Using sv_packetdelay al