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

--- Comment #14 from Sebb <[email protected]> ---
(In reply to Danny Lade from comment #13)
> > In comment #9 you wrote:
> > 
> > > But the queue is only accessed two times 1) at the initializing for each
> > > thread (see statisticalMapSelector) and 2) at the testEnded() method.
> >  
> > One thread initialises the queue, another processes it.
> > 
> No, the same thread does this. 
> 
> Main: create SampleSender, therefore create queue
> Main: start threads
> Thread 1: append map to queue

The queue entry is set up (i.e. initialised) by a different thread.

Also Thread 1 adds items to the queue, which are later accessed by a different
thread in testEnded(). This also needs to be done in a way that ensures safe
publication, e.g. by using a thread-safe queue (which seems to be the case).

> Thread 1: add sample data to own map
> ...
> Thread N: append map to queue
> Thread 1: add sample data to own map
> ...
> Thread N: add sample data to own map
> Main: all threads ended
> Main: call testEnded(), therefore read queue and send sample data
> 
> > > As I already mentioned, the solution we've made works quite well in our 
> > > high
> > > load scenarios - believe me.
> > 
> > Unfortunately that does not prove anything.
> >
> No it doesn't, but it also sounds like 'Don't trust anyone' to me. 

I'm just saying it proves nothing.

> So, how to prove? What do you have in mind?

Code inspection should be used to show that objects shared between threads are
protected by a common lock.

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

Reply via email to