commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brekke, Jeff" <Jeff.Bre...@qg.com>
Subject [NET] RE: TelnetInputStream.java in commons-net
Date Fri, 14 Nov 2003 18:45:27 GMT

Thanks Dimitrios, I'm forwarding on to the commons-dev list.



Jeff Brekke

Quad/Graphics

West Allis, Wisconsin
414-566-3302 phone
jeff.brekke@qg.com
www.QG.com


> -----Original Message-----
> From: Dimitrios Lagkouvardos [mailto:dlagkouvardos@digitalfairway.com]
> Sent: Friday, November 14, 2003 12:37 PM
> To: Brekke, Jeff
> Subject: TelnetInputStream.java in commons-net
> 
> 
> Hi,
> I see that commons-net 1.1.0 fixes the following bug in
> TelnetInputStream.java:
> 
> "If the buffer queue run full, the run() method sometimes 
> hangs forever.
> Changed wait() to wait(100) as with other changes in 
> TelnetInputStream.
> Fix submitted From: J. Matysiak ( j.matysiak@cenit.de )."
> 
> The fix added the following line to the read() method, and 
> changed a call
> from __queue.wait() to __queue.wait(100):
> 
> --__bytesAvailable;
> 
> A more efficient fix is the following, leaving the original call to
> __queue.wait():
> 
> if (--__bytesAvailable == 0) {
>   __queue.notify();
> }
> 
> In this way:
> - The producer thread is notified immediately when needed.
> - The producer thread does not waste 100 millis.
> - There is less thread context switching.
> 
> - lag
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message