- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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).
Thanks.
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
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).
Thanks.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you considered creating a shared vector of thread_specific vectors, where each thread uses TLS to remember its own thread_specific vector.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't clearly get it...
Each thread has ETS vector, which is stored in the global shared vector. Is that it?
Thanks!
Each thread has ETS vector, which is stored in the global shared vector. Is that it?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, or they can have an allocated standard template library vector (since it is not shared other than for collation).
Jim
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok!! I'll give it a try!
Thanks Jim!!
Thanks Jim!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting jimdempseyatthecove
Have you considered creating a shared vector of thread_specific vectors, where each thread uses TLS to remember its own thread_specific vector.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page