On Sun, 2008-06-22 at 23:04 +0200, Quintin Beukes wrote: > Hey, > > I was busy stepping the NIO code, and noticed the following: > this.dispatchers[this.currentWorker++ % this.workerCount].addChannel(entry); > > Is this safe? Since currentWorker will eventually wrap around to a > negative number. It will take a while, a long long while, but I don't > notice any resets anywhere, so I assume after running for a few > months, or under extremely high volume it will eventually fail. >
I do not think it is unsafe given the fact we are only interested in more or less equal distribution of new connections among existing workers, but I agree it would be nice to have the count wrap around to 1. We happily take patches ;-) > PS: Of all the open source projects' source code I've worked with, > HttpComponents have been the biggest pleasure of all. The code is > very... "intelligable". Sometimes code is over "complexified", or made > so abstract that one cannot see how things link up with each other, or > just badly written. Thanks for it all! > I am glad you found source code comprehensible. I hope it is useful too. Cheers Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
