От: | _hum_ | ||
Дата: | 25.04.18 15:56 | ||
Оценка: |
const long nSize = 100000;
std::vector<float> v(nSize);
#pragma omp parallel for
for (long i = 0; i < nSize; ++i)
v[i] = sqrt(i);
И там же дальше проводятся рассуждения, что такой подход довольно ограничительный, и что намного разумнее:The standard says:
Except where explicitly specified in this standard, it is implementation-defined which functions in the Standard C++ library may be recursively reentered.
The standard should mandate that all standard functions must be reentrant, unless otherwise specified.
I would
completely ignore the possibility of of any standard function being non-reentrant, except when it is clear that the function cannot be reasonably made reentrant.