You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2006/03/12 04:44:55 UTC

[jira] Resolved: (DIRMINA-183) Use of "Double-Checked Locking" in ThreadPoolFilter

     [ http://issues.apache.org/jira/browse/DIRMINA-183?page=all ]
     
Trustin Lee resolved DIRMINA-183:
---------------------------------

    Resolution: Fixed
     Assign To: Trustin Lee

Removed DCL idiom from ThreadPoolFilter.

> Use of "Double-Checked Locking" in ThreadPoolFilter
> ---------------------------------------------------
>
>          Key: DIRMINA-183
>          URL: http://issues.apache.org/jira/browse/DIRMINA-183
>      Project: Directory MINA
>         Type: Bug
>     Reporter: peter royal
>     Assignee: Trustin Lee
>      Fix For: 0.9.3

>
> In ThreadPoolFilter, the Double-Checked Locking pattern is used:
>         SessionBuffer buf = ( SessionBuffer ) buffers.get( session );
>         if( buf == null )
>         {
>             synchronized( buffers )
>             {
>                 buf = ( SessionBuffer ) buffers.get( session );
>                 if( buf == null )
>                 {
>                     buf = new SessionBuffer( session );
>                     buffers.put( session, buf );
>                 }
>             }
>         }
> .. this could lead to problems on multi-CPU systems (http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira