This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] [gomp] Add thread attribute customization




On 03/09/15 13:05, Jakub Jelinek wrote:
On Thu, Sep 03, 2015 at 12:57:53PM +0200, Sebastian Huber wrote:
>On 03/09/15 12:19, Jakub Jelinek wrote:
> >>@@ -292,7 +292,7 @@ gomp_team_start (void (*fn) (void *), void *data, unsigned nthreads,
> >>>    bool nested;
> >>>    struct gomp_thread_pool *pool;
> >>>    unsigned i, n, old_threads_used = 0;
> >>>-  pthread_attr_t thread_attr, *attr;
> >>>+  pthread_attr_t mutable_attr, *attr;
> >Just wonder why have you renamed this variable.  It is a thread attribute
> >after all, even after your changes.  mutable_attr doesn't make much sense to
> >me.
>
>We have only thread attributes in this function: mutable_attr and attr. The
>attr is initialized with &gomp_thread_attr and gomp_thread_attr is supposed
>to be read-only by this function. Under certain conditions we have to modify
>the initial attributes. Since gomp_thread_attr is read-only, we have to copy
>it and then modify the copy. For this we need some storage: mutable_attr.
So use local_thread_attr if you want to stress it, but IMHO thread_attr
just just fine.  I really don't like mutable_attr.

Ok, if I don't rename thread_attr, is the patch ok?

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]