https://issues.apache.org/bugzilla/show_bug.cgi?id=56456

            Bug ID: 56456
           Summary: Suggesting lock-free endpoint state machine
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: bluewolf.ch...@gmail.com

Created attachment 31558
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31558&action=edit
EndpointStateMachine class using AtomicInteger

In regard to https://issues.apache.org/bugzilla/show_bug.cgi?id=55799 , 

now org.apache.tomcat.websocket.WsRemoteEndpointImplBase has its StateMachine
to handle wrong concurrent accesses correctly.

I've reading the code carefully and have concluded that it would be more
effective if it uses lock-free synchronization using one of AtomicXXX classes.


Based on https://www.ibm.com/developerworks/java/library/j-jtp11234/ and some
other articles,

I've changed 'state' to use AtomicInteger, and have adopted CAS to remove all
'synchronized' blocks.

And for the unit test and readability, StateMachine class is moved to the upper
class, having the name 'EndpointStateMachine'.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to