https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60035

--- Comment #13 from Nathaniel J. Smith <njs at pobox dot com> ---
Unfortunately, AFAICT, the omp_pause_resource APIs don't actually solve the
problem.

They're fine and useful if you have a single piece of code that wants to use
both omp and fork(). But, this was never a *huge* issue, because if you knew
you were using omp then you also knew that fork() wasn't going to work, and
could use some workaround.

The really nasty case is when the code using omp and the code using fork() are
in entirely different pieces of code, that don't know about each other (e.g.,
different shared libraries). That's the motivating use case for this patch. I
don't see how the omp_pause_resource APIs help with this. The best you could do
is to set up a pre-fork hook to call omp_pause_resource_all, but that would be
equivalent to my first patch that got rejected for breaking standards-compliant
programs.

(In practice, the effect of this issue has been that the whole scientific
python ecosystem simply avoids omp where-ever possible. That's why no one's
been nagging about this patch. It still seems like a shame to me that all this
work goes into the omp runtime and then it gets ruled out for so many users for
such a trivial thing, but so it goes I guess.)

Reply via email to