This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] New condvar implementation that provides stronger ordering guarantees.
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Torvald Riegel <triegel at redhat dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, David Miller <davem at davemloft dot net>, Darren Hart <dvhart at infradead dot org>
- Date: Tue, 14 Jun 2016 16:40:58 -0400
- Subject: Re: [PATCH] New condvar implementation that provides stronger ordering guarantees.
- Authentication-results: sourceware.org; auth=none
- References: <1464268895 dot 17104 dot 14 dot camel at localhost dot localdomain> <9ba4528e-6c48-f832-825a-bdc68c37eb47 at redhat dot com> <1465928107 dot 19633 dot 109 dot camel at localhost dot localdomain> <3a0380b8-d958-6af6-28ca-d228353d9ef8 at redhat dot com> <1465931244 dot 19633 dot 120 dot camel at localhost dot localdomain> <e6f9aa4d-c343-9285-5c75-da10362eb307 at redhat dot com>
On 06/14/2016 04:14 PM, Florian Weimer wrote:
>> I believe pthread_cond_common.c is similar. It doesn't use the
>> preprocessor to alter any behavior, but just uses C to provide
>> commonly used functionality. It doesn't provide any functions that
>> are just declarations, so something a C header would typically do.
>
> We already have header files which contain inline functions,
> something that is quite natural.
These are usually marked 'always inline' though aren't they? They
are basically equivalent to enhanced macros.
> If the functions are not expected to be inlined, you should put them
> in their own file, and declare them with attribute_hidden for PLT
> avoidance.
I think the point here is that they may be inlined and we want to
leave it up to the compiler to decide.
If we put them in their own file and compile that into an object file,
we won't have a chance to inline them until we get LTO.
If all the functions had been marked static always inline then I would
agree it would make sense for us to place them into a header, since
they are the equivalent of macros.
However, in this grey zone where Torvald has static functions which
may or may not be inlined (you want to leave it up to the compiler
to decide) it seems to me like using a *.c file and including it
from other C files seems like a reasonable way to structure this.
$0.02.
--
Cheers,
Carlos.