Re: WebSockets Thread Safety question

2013-07-11 Thread Darryl Miles
Martin Gainty wrote: use java.util.Collections.synchronizedList or even better use a ConcurrentLinkedQueue class (with offer()/peek()/poll() APIs), as I suspect you never need to access the middle elements in the ordered list directly, so why carry this extra java.util.List API baggage/bloat

Re: WebSockets Thread Safety question

2013-06-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Chris, On 6/3/13 6:42 AM, chris derham wrote: >> When I use the syntax from the samples in the onTextMessage() >> method, I get ConcurrentModificationException if I have more than >> one client sending data to the server at the same time: >> >> for

RE: WebSockets Thread Safety question

2013-06-03 Thread Martin Gainty
ulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: ch...@derham.me.uk > Date: Mon, 3 Jun 2013 07:42:01 -0300 > Subject: Re: WebSockets Thread Safety question > To: users@tomcat.apache.org > > > When I use the syntax

Re: WebSockets Thread Safety question

2013-06-03 Thread chris derham
> When I use the syntax from the samples in the onTextMessage() method, I get > ConcurrentModificationException if I have more than one client sending data > to the server at the same time: > > for(MyMessageInbound mmib: mmiList){ > CharBuffer buffer = CharBuffer.wrap(cb

Re: WebSockets Thread Safety question

2013-06-03 Thread Mark Thomas
On 03/06/2013 08:45, Martin Schmiedel wrote: > About the mmiList object, why isn't it a Threadsafe Collection? Where / how is that object declared? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For addition

WebSockets Thread Safety question

2013-06-03 Thread Martin Schmiedel
I have recently had problems with a simple WebSocket sample I'm developing. Tomcat Version is 7.0.39. When I use the syntax from the samples in the onTextMessage() method, I get ConcurrentModificationException if I have more than one client sending data to the server at the same time: