[Patch] C1X threading support
Jilles Tjoelker
jilles at stack.nl
Sun Dec 18 13:27:44 UTC 2011
On Sat, Dec 17, 2011 at 12:31:26AM +0200, Kostik Belousov wrote:
> On Fri, Dec 16, 2011 at 11:19:59PM +0100, Ed Schouten wrote:
> > * Kostik Belousov <kostikbel at gmail.com>, 20111216 23:09:
> > > If application that does not use the new interface supposed to be
> > > able to implement function with new names, then the not-underscored
> > > symbols must be weak.
> > For example when an application wants to implement its own functions
> > that are named thrd_*(), for example?
> Yes. The realistic example is the code written to C99/SUSv4 conformance
> that happens to define thrd_<something>.
> It might be that easiest solution is to put the functions into
> separate library, besides defining them weak.
Another idea is to implement the functions as static inline (with the
possible exception of thrd_create() and perhaps some more). This
pollutes the namespace of C1x programs with pthread_* though.
> > > Do you have reference to the draft ?
> > Yes, sure:
> > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
> BTW, it looks not very useful to add a bunch of threading functions
> without at least trying to specify the memory model.
I see a discussion of the memory model in 5.1.2.4 Multi-threaded
executions and data races.
--
Jilles Tjoelker
More information about the freebsd-threads
mailing list