- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Intel TBB concurrent_hash_map and concurrent_vector with OpenMP for loop parallelization. I've used tbb::task_scheduler_init. But I'm getting segemntation fault. Interesting matter is when I open the terminal and run for first time the code in that terminal, it works perfectly. But after first run in terminal, if I run that code again in same terminal without closing it gives segmentation fault. How can I debug that?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After checking in Valgrind, I've found the problem. I was trying to sort concurrent_vector by using std::sort. Can I use std::sort to sort concurrent_vector? Otherwise how can I do it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess you can try to use tbb::parallel_sort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Neither sort nor parallel_sort is allowed while the container is also being accessed by other threads. If it is not, both should work.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page