You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Zoltan Farkas (JIRA)" <ji...@apache.org> on 2011/02/02 21:08:29 UTC

[jira] Created: (POOL-182) Issues with org.apache.commons.pool2.performance. PerformanceTest

Issues with org.apache.commons.pool2.performance. PerformanceTest
-----------------------------------------------------------------

                 Key: POOL-182
                 URL: https://issues.apache.org/jira/browse/POOL-182
             Project: Commons Pool
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Zoltan Farkas
            Priority: Trivial


 the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, nrSamples
 is not correct.


 for ex the following totalBorrowTime += borrowTime is not atomic resulting in a
 race condition.

 one way to fix this is using the java.util.concurent Atomic variants or even
 better,
 make these variables members of MyThread and aggregate them at the end of the
 test,
 this way there will be no need to use Atomic and thus increasing efficiency, and
 accuracy of the test of the test.

 also:

 private boolean start;

 needs to be volatile, due to visibility issue.
 (when updating start other threads might not pick up the value)



-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (POOL-182) Issues with org.apache.commons.pool2.performance. PerformanceTest

Posted by "Mark Thomas (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/POOL-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Thomas resolved POOL-182.
------------------------------

    Resolution: Fixed

I merged the proposed match manually. Functional changes were kept. Cosmetic ones were not.
                
> Issues with org.apache.commons.pool2.performance. PerformanceTest
> -----------------------------------------------------------------
>
>                 Key: POOL-182
>                 URL: https://issues.apache.org/jira/browse/POOL-182
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Zoltan Farkas
>            Priority: Trivial
>             Fix For: 2.0
>
>         Attachments: PerformanceTest.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
>  the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, nrSamples
>  is not correct.
>  for ex the following totalBorrowTime += borrowTime is not atomic resulting in a
>  race condition.
>  one way to fix this is using the java.util.concurent Atomic variants or even
>  better,
>  make these variables members of MyThread and aggregate them at the end of the
>  test,
>  this way there will be no need to use Atomic and thus increasing efficiency, and
>  accuracy of the test of the test.
>  also:
>  private boolean start;
>  needs to be volatile, due to visibility issue.
>  (when updating start other threads might not pick up the value)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (POOL-182) Issues with org.apache.commons.pool2.performance. PerformanceTest

Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/POOL-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Thomas updated POOL-182:
-----------------------------

    Fix Version/s: 2.0

> Issues with org.apache.commons.pool2.performance. PerformanceTest
> -----------------------------------------------------------------
>
>                 Key: POOL-182
>                 URL: https://issues.apache.org/jira/browse/POOL-182
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Zoltan Farkas
>            Priority: Trivial
>             Fix For: 2.0
>
>         Attachments: PerformanceTest.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
>  the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, nrSamples
>  is not correct.
>  for ex the following totalBorrowTime += borrowTime is not atomic resulting in a
>  race condition.
>  one way to fix this is using the java.util.concurent Atomic variants or even
>  better,
>  make these variables members of MyThread and aggregate them at the end of the
>  test,
>  this way there will be no need to use Atomic and thus increasing efficiency, and
>  accuracy of the test of the test.
>  also:
>  private boolean start;
>  needs to be volatile, due to visibility issue.
>  (when updating start other threads might not pick up the value)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (POOL-182) Issues with org.apache.commons.pool2.performance. PerformanceTest

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/POOL-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000846#comment-13000846 ] 

Simone Tripodi commented on POOL-182:
-------------------------------------

Thanks for the patch, unfortunately it contains also code reformat that makes not easier to understand what was really the subject of the modification.
Can you please provide a second patch that only contains your suggestions?
Thanks in advance!!!

> Issues with org.apache.commons.pool2.performance. PerformanceTest
> -----------------------------------------------------------------
>
>                 Key: POOL-182
>                 URL: https://issues.apache.org/jira/browse/POOL-182
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Zoltan Farkas
>            Priority: Trivial
>         Attachments: PerformanceTest.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
>  the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, nrSamples
>  is not correct.
>  for ex the following totalBorrowTime += borrowTime is not atomic resulting in a
>  race condition.
>  one way to fix this is using the java.util.concurent Atomic variants or even
>  better,
>  make these variables members of MyThread and aggregate them at the end of the
>  test,
>  this way there will be no need to use Atomic and thus increasing efficiency, and
>  accuracy of the test of the test.
>  also:
>  private boolean start;
>  needs to be volatile, due to visibility issue.
>  (when updating start other threads might not pick up the value)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (POOL-182) Issues with org.apache.commons.pool2.performance. PerformanceTest

Posted by "Mohit Soni (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/POOL-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mohit Soni updated POOL-182:
----------------------------

    Attachment: PerformanceTest.patch

Current patch replaces use of volatiles with 'TaskStats' object and 'Callable'(s). 
Each thread executes a 'PerfTask' and collects the stats inside 'TaskStats' object.
When all threads return, using 'TaskStats' objects of each thread, an aggregate 'TaskStats' object is created and output is displayed.

> Issues with org.apache.commons.pool2.performance. PerformanceTest
> -----------------------------------------------------------------
>
>                 Key: POOL-182
>                 URL: https://issues.apache.org/jira/browse/POOL-182
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Zoltan Farkas
>            Priority: Trivial
>         Attachments: PerformanceTest.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
>  the use volatiles : waiting,complete,totalBorrowTime, totalReturnTime, nrSamples
>  is not correct.
>  for ex the following totalBorrowTime += borrowTime is not atomic resulting in a
>  race condition.
>  one way to fix this is using the java.util.concurent Atomic variants or even
>  better,
>  make these variables members of MyThread and aggregate them at the end of the
>  test,
>  this way there will be no need to use Atomic and thus increasing efficiency, and
>  accuracy of the test of the test.
>  also:
>  private boolean start;
>  needs to be volatile, due to visibility issue.
>  (when updating start other threads might not pick up the value)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira