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 | 996 | February 21, 2020 | |
| Question on multithreading/vectorizing loops | 9 | 744 | March 22, 2023 | |
| How to spawn persistent threads and reuse them? | 16 | 347 | February 17, 2025 | |
| Parallelization of several independent loops | 10 | 573 | August 18, 2022 | |
| Multithreading with shared memory caches | 27 | 2107 | June 13, 2023 |