[mnet-devel] BandwidthThrottler patch

Zooko zooko at zooko.com
Tue Feb 4 16:03:31 GMT 2003


> It's this line right here:
>       DoQ.doq._asyncorelooper.add_task(self.used, args=(0,))
> 
> DoQ.doq does not have an attrib called '_asyncorelooper'.  How does it need
> to be changed.

Ah.  Okay, the Happy Good Fun way to do it is integrate Twisted's reactor, 
ensure that there is always exactly one thread per Python VM, and replace that 
with "DoQ.doq.add_task(self.used, args=(0,))".

Then replace all occurrences "DoQ.doq.add_task(func, delay, (arg1, arg1,))" with 
"twisted.internet.reactor.callLater(delay, func, arg1, arg2)".

The Fast and Convenient way to do it is replace 'DoQ.doq._asyncorelooper' with 
'pyutil.Asyncore.selector'.

Note: I still believe that going down to a single thread from the current two-
thread model will cost a couple of percentage points of network performance, but 
I don't care about that compared to ease-of-maintenance.  Anyway if we use the 
optimized C modules from Twisted that might gain back a couple of percentage 
points.

--Z




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
mnet-devel mailing list
mnet-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mnet-devel




More information about the Mnet-devel mailing list