[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: ISO C11 threads
Andrea Francesco Iuorio
RE: ISO C11 threads
Sun, 16 Mar 2014 00:07:26 +0100
I' m a student that is trying to propose for this project and it is correct: it
should be possible to map pthread types to c11 types, making possible cast one
to the other ( and in theory we can use pthread functions to thrd type and so
on ). The only problem is that pthread functions and types implementation must
be refactored because of namespaces problems. In the glibc alpha mailing list
you can read more about this.
From: Kevin Cox
Sent: 15/03/2014 22.10
Subject: ISO C11 threads
I have been looking at the project suggestions for glibc and the C11
threading has really caught my eye. I have been using posix threads and
c for a long time and I thing it would be great to implement this API.
I feel that I have all the skills required including years of c
experience (mostly pet projects) and using the pthreads API a number of
times. I have looked at the C11 API and it appears to map fairly
cleanly to pthreads.
I am just starting on my proposal and wanted to throw some of my main
ideas here so that suggestions can be made before I submit my first draft.
Other than implementing the required API my main thought is that
interoperability between pthreads and C11 threads should be allowed. I
am considering having thrd_t values be equivalent to pthread_t values so
that if you wanted to call an advanced feature from pthread you don't
need to abandon C11 threads. The downside to this is it could possible
become awkward in the future if additional data was needed to be stored
by the C11 threads. Therefore the other solution would be to have an
additional function which returned a pthread_t associated with a thrd_t
(which could be an identity macro for the foreseeable future).
I would also like to do a similar thing for mutexes and condition
variables if possible (I need to look into this a bit more).
The other main feature is extensive tests. Testing multithreaded
applications can be hard but I think it is important to ensure correctness.
How does this sound? I would appreciate and feedback and suggestions
about other key points.