From owner-freebsd-threads@FreeBSD.ORG Sun Dec 18 13:27:44 2011 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C109106574A; Sun, 18 Dec 2011 13:27:44 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id ECF1C8FC17; Sun, 18 Dec 2011 13:27:43 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E2B0A3592DF; Sun, 18 Dec 2011 14:27:42 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B56AB28468; Sun, 18 Dec 2011 14:27:42 +0100 (CET) Date: Sun, 18 Dec 2011 14:27:42 +0100 From: Jilles Tjoelker To: Kostik Belousov Message-ID: <20111218132742.GA52983@stack.nl> References: <20111216214913.GA1771@hoeg.nl> <20111216220914.GW50300@deviant.kiev.zoral.com.ua> <20111216221959.GB1771@hoeg.nl> <20111216223126.GX50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111216223126.GX50300@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Ed Schouten , threads@freebsd.org Subject: Re: [Patch] C1X threading support X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 13:27:44 -0000 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 , 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_. > 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