This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: C11 threads ABI questions - enum values


Hi guys.

I'm working on a early implementation at the moment since I'm done
with my internship but I still have some doubts:

-How can I use pthread_* functions for my threads.h functions? I
guessed that would be including the pthread.h in threads.c but then we
cannot map objects between both in header file.

-Is it some pthread refactoring needed? I remember a time ago somebody
suggested that idea.

I have a small and dummy standalone implementation working, not
integrated in glibc code yet, but still have the issues that user can
call pthread functions from main so i guess some help would be
appreciated. I know these doubts are pretty simple but I'm some kind
of newbie and I'm trying to learn the best way to solve it.

Cheers.

2014-10-02 2:17 GMT+02:00 Rich Felker <dalias@libc.org>:
> On Wed, Oct 01, 2014 at 02:30:22PM -0700, Roland McGrath wrote:
>> > Thanks for the feedback. Since then we've got C11 threads support
>> > committed in musl, with the following definitions. Are these
>> > acceptable for glibc too? They're the same ones I proposed before.
>>
>> No guarantees until we actually implement something in glibc.  But they
>> seem fine to me.  The possible exception is that for interfaces where the
>> only valid thing is to pass in of the specified enum values, there is
>> something to be said for none of those values being zero (or -1) so that
>> applications can't sloppily use literal 0 (or uninitialized statics or the
>> like) and have it work but be non-portable and nonconforming.
>
> My motive for wanting success to have a value of 0 is that it allows
> some functions to be pure aliases or tail-calls where otherwise some
> heavier wrapping would be needed. Everyone expects success to be 0
> anyway. And since it's a return value, I don't think you'd have the
> issue of passing literal zeros.
>
> For mutex types, I suppose there's some risk of "sloppily" passing a
> literal 0 without meaning mtx_plain, but I think it's a small issue
> and I hope we can agree that keeping a common set of constants for ABI
> purposes is of more value.
>
> Rich



-- 
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.


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