> From: Mark Thomas [mailto:[email protected]] 
> Subject: Re: svn commit: r1703194 - 
> /tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

> What prevents the concurrency is that there is only ever one background
> thread. The only was I see this happening is:
> - T1 runs and expires all the current sessions.
> - The container unregisters itself from background processing since it
>   has no sessions
> - It was the only thing registered for background processing so the
>   T1 is terminated by the BackgroundProcessManager
> - A new WeBSoket session is opened
> - The container registers itself with the BackgroundProcessManager
> - A new background processing thread T2 is started
> - T2 runs

> RV-Predict indicated that there was a race. Was this a false positive?

Sounds like a false positive to me.  There are numerous implicit 
synchronizations in the above sequence, so the volatile is not particularly 
useful (but it's not terribly expensive either).

> I was looking at keyset

> "they are guaranteed to traverse elements as they existed upon
> construction exactly once, and may (but are not guaranteed to) reflect
> any modifications subsequent to construction."

Ok, finally found the above under 
java/util/concurrent/package-summary.html#Weakly, so that seems to be ok.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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

Reply via email to