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


I was supposed to be working on this but as I said before I'm not
having as much time as I would like to.

> For the result codes, Jens Gustedt has proposed matching their
> definitions with "corresponding" POSIX errno codes. This potentially
> allows some of the C11 functions to be implemented as aliases for (or
> tail calls to) POSIX threads functions, but some care is needed since
> the semantics for the error codes and which conditions they're
> returned in may not be exactly the same. I'm generally not a fan of
> this approach, since it pulls in a dependency of target-specific
> values (the errno values vary widely per target) in a new header that
> could otherwise be largely arch-generic and requires synchronizing
> these values without actually including <errno.h> (which is outside
> the namespace for this header). I would prefer just assigning enum
> values sequentially from 0 with 0 being success. But I want to see
> what glibc folks want to do.

In this topic I think the same way than you do, specially if we want
to forbid users to do things like matching and comparing types from
POSIX to C11 threads, so if we use POSIX as a base, we should then
isolate it to make sure we isolate both libraries.

> For the mtx types, mtx_plain and mtx_timed really could both have the
> same value; I can't see there being any reasonable implementation
> where it would matter at initialization time whether you want to
> perform timed operations on the mutex or not. And the standard does
> not seem to preclude this. In that case, the values of mtx_plain and
> mtx_timed could match the value of PTHREAD_MUTEX_NORMAL and the values
> or'd with mtx_recursive could match PTHREAD_MUTEX_RECURSIVE. Of course
> doing this is not necessary and I'm open to other choices of values.

Well in this case I'm not really sure what to do with mtx_plain and
mtx_timed, but if they are defined in a different way in the C11
standard, we need to stick to the standard definition, don't we? I
don't really understand why it's useful to match values between
libraries. I know it easier to implement and makes the coding way
easier but maybe we can get some not desired uses of them.

I'm not an expert so I just want to know what others think.

Cheers.


-- 
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]