Is enumerable thread specific the right choice here?
I've got a vector with id's of particles objects [from a preexistent class Particle, that has a private attribute called next_event. It stores the id of the next particle that is scheduled to collide]. What I want is to simulate the effects of the collisions of these particles locally and, when finished, check if there are any inconsistencies between them and update the global state.
I was planning to simulate each particle collision in a task, saving the results in, for example, tbb::enumerable_thread_specific> and using continuation-passing style, where the continuation would do the check_and_save job.
So, my question is if it is possible to rejoin the local data of each task into a new vector in the continuation. Or should it be done in a global process outside a task?
Sorry if you don't understand a thing, I tried to explain it as clear as I could (also sorry about my english).