From owner-svn-ports-head@FreeBSD.ORG Mon Mar 23 09:19:36 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D67DAC9B; Mon, 23 Mar 2015 09:19:36 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 98CDCA37; Mon, 23 Mar 2015 09:19:36 +0000 (UTC) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t2N9Ilhs024530 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Mar 2015 09:19:21 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r381955 - head/graphics/gdal From: David Chisnall In-Reply-To: <20150323015759.GA34402@FreeBSD.org> Date: Mon, 23 Mar 2015 09:18:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <22E9C187-E473-40FB-A26C-7666477BEB58@FreeBSD.org> References: <201503222011.t2MKBHq7091087@svn.freebsd.org> <20150323015759.GA34402@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.2070.6) Cc: Sunpoet Po-Chuan Hsieh , svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 09:19:37 -0000 On 23 Mar 2015, at 01:58, Alexey Dokuchaev wrote: >=20 > Is -pthread going away anytime soon? I'm a bit worried of more alike > changing one to another; since they're identical right now on FreeBSD, > I'd rather reduce amount of patching, leaving whatever is picked by > upstream, unless -lpthread really should be preferred over -pthread > for some reason I'm unaware of (and ready to learn about). Tijl's comment on the blog is incomplete. The history of -pthread goes = back to the creation of the POSIX threading standard and predates = FreeBSD implementation. Pthreads were designed to support multiple = implementations (N:M with scheduler activations, 1:1 with kernel = threads, and N:1 with a modified C library that used timer interrupts = and substituted asynchronous system calls for sync ones). A number of = the prototype implementations exposed different things in headers when = compiling with pthreads support, hidden behind #ifdef _REENTRANT or = #ifdef _MT. In particular, a number of fast path macros that only = worked in the single-threaded case needed removing. On some systems, = you needed a completely different set of libc headers. The -pthread flag was intended as a compiler and linker flag, providing = the correct predefined macros (and alternate include paths) for the = system when building with thread support as well as linking the pthread = library (if one is required). Today, -pthread on FreeBSD as a linker = flag is identical to -lpthread. As a compile flag, I believe that = -pthread is silently accepted, whereas -lpthread will give a unused = argument warning. The -pthread flag was proposed for inclusion in UNIX98, but was never = consistently or widely adopted. It's basically dead now, though not = actively harmful. There is no particular reason to prefer one form to = the other (-pthread is, in theory, more portable, though theory and = practice can differ). David