From owner-freebsd-threads@FreeBSD.ORG Mon Dec 19 15:05:46 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 B46D3106566C; Mon, 19 Dec 2011 15:05:46 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 776898FC0A; Mon, 19 Dec 2011 15:05:46 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pBJF5hQc031442; Mon, 19 Dec 2011 10:05:43 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pBJF5haX031441; Mon, 19 Dec 2011 10:05:43 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 19 Dec 2011 10:05:43 -0500 From: David Schultz To: Ed Schouten Message-ID: <20111219150543.GA31384@zim.MIT.EDU> Mail-Followup-To: Ed Schouten , Jilles Tjoelker , Kostik Belousov , threads@freebsd.org, arch@freebsd.org References: <20111216214913.GA1771@hoeg.nl> <20111216220914.GW50300@deviant.kiev.zoral.com.ua> <20111216221959.GB1771@hoeg.nl> <20111216223126.GX50300@deviant.kiev.zoral.com.ua> <20111218132742.GA52983@stack.nl> <20111218161503.GG1771@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111218161503.GG1771@hoeg.nl> Cc: threads@FreeBSD.ORG, arch@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: Mon, 19 Dec 2011 15:05:46 -0000 On Sun, Dec 18, 2011, Ed Schouten wrote: > Hi Jilles, > > * Jilles Tjoelker , 20111218 14:27: > > 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. > > Hmmm... Indeed. This would change the entire C1X threading API simply > into a compile-time translation mechanism to pthreads. Unfortunately, it > would make things like debugging a bit harder, as placing breakpoints on > the functions become a bit harder. > > Are there any objections to such an approach? Technically there's a requirement that external definitions be provided. Applications that break if you don't are pretty rare, but why not do it right by providing some wrappers or symbol aliases in the library? Nothing precludes you from also defining a non-static inline function in the header file (but note that you may need an ifdef to handle the differences between GNU and C99 inlines.)