DO NOT REPLY [Bug 34935] New: - [pool] changes the borrowObject method so it advoids catching an exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DO NOT REPLY [Bug 34935] New: - [pool] changes the borrowObject method so it advoids catching an exception

Bugzilla from bugzilla@apache.org
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG?
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34935>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND?
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34935

           Summary: [pool] changes the borrowObject method so it advoids
                    catching an exception
           Product: Commons
           Version: 1.2 Final
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Pool
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


From Sandy McArthur  2005-05-13 23:38

changes the borrowObject method so it advoids catching an exception
as part of the normal code path

This is a performance patch for the borrowObject method. The current (1.2)
implementaion of this method uses an EmptyStackException thrown by the backing
Stack's pop() method as part of the normal code flow to determine if the
factory should be used to make a new object.

When possible this should be advoided because a lock across the entire JVM must
be aquired when populating the stack trace of an Exception. This can have a
siginificant effect on a multi-processor box.

In this situation it is possible to advoid an Exception by checking the result
of the Stack.empty() method. This patch replaces the try/catch with an if/else.

--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]