This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libgomp: Introduce gomp_thread::spare_team
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Jul 2015 09:35:09 +0200
- Subject: Re: [PATCH] libgomp: Introduce gomp_thread::spare_team
- Authentication-results: sourceware.org; auth=none
- References: <1436271477-16941-1-git-send-email-sebastian dot huber at embedded-brains dot de> <55A35B81 dot 1040806 at embedded-brains dot de> <20150713071730 dot GL1788 at tucnak dot redhat dot com> <55A36812 dot 7050308 at embedded-brains dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jul 13, 2015 at 09:26:10AM +0200, Sebastian Huber wrote:
>
>
> On 13/07/15 09:17, Jakub Jelinek wrote:
> >On Mon, Jul 13, 2015 at 08:32:33AM +0200, Sebastian Huber wrote:
> >>Ping.
> >Space in gomp_thread is precious, that is a TLS variable, and you want
> >to only handle the non-nested case only anyway, so why don't you
> >just try to use
> >if (thr->thread_pool)
> > {
> > struct gomp_thread *last_team = thr->thread_pool->last_team;
> > if (last_team && last_team->nthreads == nthreads)
> > {
> > team = last_team;
> > thr->thread_pool->last_team = NULL;
> > }
> > }
> >?
>
> I started with this variant, but it needs one more if to check the thread
> pool. Since space seems to be more important, I will adjust the patch.
I guess you can use if (__builtin_expect (thr->thread_pool != NULL, 1))
the first GOMP_parallel etc. in a thread is slower anyway.
It also needs a check that thr->ts.team == NULL.
Jakub