Can we specify a std::vector object in the firstprivate clause of a openmp task pragma?
Is is possible to make a vector object firstprivate?
It compiles and runs correctly... It is always threadsafe?
Yes you can
So basically as long as
Note that the STL containers satisfy these criteria but you may alter the semantics by doing a container of (non-shared) pointer elements, etc.
You're good to go
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.