title: Data structure for non-blocking aggregation of Thread values?
body: <p><strong>Background:</strong>
  I have a large thread-pool in java each process has some internal state. 
  I would like to gather some global information about the states -- to do that I have an associative commutative aggregation function (e.g. sum -- mine needs to be plug-able though).</p>
  
  <p>The solution needs to have a fixed memory consumption and be log-free in best case not disturbing the pool at all. So no thread should need to require a log (or enter a synchronized area) when writing to the data-structure. The aggregated value is only read after the threads are done, so I don't need an accurate value all the time. Simply collecting all values and aggregate them after the pool is done might lead to memory problems.
  The values are going to be more complex datatypes so I cannot use AtomicInteger etc.</p>
  
  <p><strong>My general Idea for the solution:</strong>
  Have a log-free collection where all threads put their updates to. I don't even need the order of the events.
  If it gets to big run the aggregation function on it (compacting it) while the threads continue filling it.</p>
  
  <p><strong>My question:</strong>
  Is there a data structure that allows for something like that or do I need to implement it from scratch? I couldn't find anything that directly matches my problem. If I have to implement from scratch what would be a good non-blocking collection class to start from?</p>