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: [PATCH] Fix C11 conformance issues



On 25/07/2018 10:51, Samuel Thibault wrote:
> Adhemerval Zanella, le mer. 25 juil. 2018 10:43:25 -0300, a ecrit:
>> It is expected due missing HTL ISO C threads support and both conformance
>> .out files indicates the reason ("#error "HTL does not implement ISO C
>> threads").
> 
> I thought the ISO C threads were just a layer on top of the POSIX
> threads, can't it be used on top of HTL too?
> 
> I'm not saying we should aim for this in 2.28, just wondering.
> 
> Samuel
> 

Currently implementation is based on POSIX internally, although it
does not require to be (Florian has suggested we might use a more
streamline implementation in the future).

However you will need to correctly tie the HTL required types with
ISO C threads without adding namespace or linkspace pollution. For
NPTL we refactored the required information on pthreadtypes-arch.h,
so to make threads.h generic HTL will need to provide a similar 
implementation (it also defines any internal structure alignment
requirement, but afaiu HTL does not have any arch-specific constraint
so far).

I am not familiar with HTL internals, but ISO C required some NPTL
internal adjustments:

  - the function pointer of the ISO C thread thrd_start start
    function has a different signature of pthread_create
    (int (*thrd_start_t) (void*) for ISO C and
    void *(*start_routine) (void *) for POSIX).

  - thrd_sleep call the syscall directly to avoid to handle the 
    expected C11 states.  It would require to add new nanosleep
    wrapper with expected behaviour.

  - thrd_yield also call the syscall directly, but adding a
    wrapper would be easier since there is no need to handle
    the return code.

However I think it quite feasible for 2.29 to add ISO C threads 
Hurd/HTL support.


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