This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [libgomp] make it possible to use OMP on both sides of a fork
- From: Richard Henderson <rth at redhat dot com>
- To: Nathaniel Smith <njs at pobox dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Feb 2014 13:22:41 -0800
- Subject: Re: [PATCH] [libgomp] make it possible to use OMP on both sides of a fork
- Authentication-results: sourceware.org; auth=none
- References: <CAPJVwBkOF5GnrMr=4d1ehEKRGkY0tHzJzfXAYBguawu9y5wxXw at mail dot gmail dot com>
> +/* This is to enable best-effort cleanup after fork. */
> +static int gomp_we_are_forked = 0;
bool, no explicit initialization, possible removal, see below.
> +static void
> +gomp_free_thread_pool (int threads_running)
bool for threads_running. It looks like a count otherwise.
> +gomp_after_fork_callback ()
(void)
> + pthread_atfork (NULL, NULL, &gomp_after_fork_callback);
& not needed.
Any reason not to just run gomp_free_thread_pool from gomp_after_fork_callback
directly? I see no restrictions on what kind of code is allowed to execute
during that callback.
r~