On 09/02/2011 12:29 AM, Amos Jeffries wrote: > On 02/09/11 04:55, Alex Rousskov wrote: >> >> I am not strongly against this, but it would be more elegant and may be >> more efficient to let the about-to-timeout connections to be reused >> instead. This can be safely done, for example, by canceling the pending >> timeout notification callback in the connection giving code. > > Cancelling calls here would mean re-writing IdleConnList to store those > calls to be cancelled.
Correct. > This patch would still be needed after all that change but would cancel > and return true instead of just returning false. I agree that isAvailable() will still be needed. I disagree on the other two counts: * The timeout canceling code should be in the "give this connection to the caller" code such as pop(), not in isAvailable(). * There will be no timeout notification pending check in isAvailable() because we do not care if such check is pending if we can cancel it. Cheers, Alex.
