Yes. That or allocating a vector of work vectors outside the threaded loop (if you want to preserve that allocation).
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How to create private arrays for each thread before a loop? | 2 | 986 | February 21, 2020 | |
| Strange behavior parallel for | 1 | 350 | December 9, 2016 | |
| Overhead in passing data to worker processes | 4 | 865 | June 11, 2018 | |
| Use Dynamic Arrays (Vectors) during Multi-threading | 7 | 2086 | September 10, 2018 | |
| Simple multi-thread loop with array | 11 | 819 | April 13, 2021 |