|
|||||||||||
|
Re: Packet rate limiting
From: Aaron Turner <aturner(at)pobox.com>
Date: Sat Jul 12 2003 - 20:14:22 EDT On Sat, Jul 12, 2003 at 12:03:09PM +0200, alessandro salvatori wrote:
I dunno. :) I've never done any RTOS work, but as I understand it, if you want to do something like this, you need a RTOS. Realize that UNIX is a multitasking OS and if you have more processes then CPU's, you're only going to get a time-slice off the CPU. Hence, between the time when you write to a socket and the data actually goes out on the wire, one or more other threads/processes may take a slice of the CPU. > anyway, nobody wants to install a real time os only for that...
Hmmm... not sure how much luck you'll get with that. Even if you're successful to limit the socket (and kernel) buffers to a single packet that won't make sending a packet an atomic event. All it will do is prevent you from writing to the socket if for some reason the kernel hasn't removed the last packet from the buffer which means that if you want to send multiple packets in quick succession, you might be making the problem worse because when the kernel finally does get to actually sending your packets, it can only send one at a time and has to wait for your program to refresh the buffer. Basically what I'm saying, is that if you ever fall behind, you may not ever be able to catch back up. I don't think the kernel makes any special case for "this buffer is full", it just generates an error back to the application. -- Aaron Turner
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:24 EDT |
||||||||||
|
|||||||||||