Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1406282437.6438.34.camel@eris.loria.fr>
Date: Fri, 25 Jul 2014 12:00:37 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: C11 threads

Hi everybody,
 after I have seen that gcc since 4.9 has a working implementation of
atomics, I convinced myself to implement C11 threads within musl.

I was really amazed, in essence this was just work of several
hours. The cleanness of musl made it really a pleasant experience.

I think the implementation is straight forward, there are only very
few minor glitches possible. But I thought that I first discuss with
you.

Choices :

 - all types are just the corresponding POSIX types

Issues :

 - a lot of C11 are just weak symbols. to avoid polluting the link
   space of a C11 application, I had to transform a lot of POSIX
   function symbols into weak symbols, too.

 - the include file threads.h includes pthread.h, so the namespace of
   the C11 implementation is poluted with the pthreads stuff

 - pthread_create and thrd_create are still too tightly linked
   together. It would be good to split the corresponding file in two,
   but this would make maintenance a bit more difficult.

 - there are still some symbols missing, for some of the functions
   that I implemented as macro. work for a winter day

 - I don't have much tests for all of this


I join my version of the threads.h file that has some comments on the
minor choices.

Jens


-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::




View attachment "threads.h" of type "text/x-chdr" (3758 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.