3

I'm new to Esper and I was wondering if the update method of an UpdateListener is executed concurrently by multiple threads. If that's the case I conclude that write on an HashMap inside this method is not safe. Is it correct, or am I missing something?

Thanks in Advance

rlar
  • 856
  • 1
  • 10
  • 15

1 Answers1

2

I'm reading the documentation currently and it's definitely a good question to ask, since it's not necessarily a yes or no answer but seems like it depends on both configuration and your implementation.

Check out Chapter 3: Processing Model, Section 13.6: Engine Threading and Concurrency, and Section 14.4.9. Engine Settings related to Concurrency and Threading.

I would also love to hear of the design choices you made and why.

Spencer Kormos
  • 8,381
  • 3
  • 28
  • 45
  • Unfortunately I didn't have time for further investigating how Esper handles concurrency and didn't tune its configuration, so I opted for the safe solution, I used a ConcurrentHashMap instead of an HashMap. – rlar Mar 27 '12 at 07:34