From owner-freebsd-threads@FreeBSD.ORG Tue Dec 20 09:48:13 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 47F381065676; Tue, 20 Dec 2011 09:48:13 +0000 (UTC) (envelope-from s_sourceforge@nedprod.com) Received: from europe2.nedproductions.biz (unknown [IPv6:2a02:748:100:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B494E8FC0C; Tue, 20 Dec 2011 09:48:12 +0000 (UTC) Received: by europe2.nedproductions.biz (Postfix, from userid 1003) id DAE659EE476; Tue, 20 Dec 2011 09:48:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nedprod.com; s=mail; t=1324374491; bh=Rs69jaibQ1OZrqifUeiHb8XS3MKtN3hE9gJpzqpcTAs=; h=From:To:Date:MIME-Version:Subject:Message-ID:In-reply-to: References:Content-type:Content-transfer-encoding: Content-description; b=cqlLV1ms0cUCUb7Z55qjpCBgLX49PjznSPpehdzZRZM1IF8aiCfBsUjvJ5d1zn1bF 2x66nnKdCFnDYFFXq7b/T4+dm+aPutTrlSNHP/6gvAmOuC8P5Fc+GaQXmmwUQjv2/7 bnSUYEIMv+PXpXf07UIOUpISvMr+ltD2hPRyYU+8= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on europe2.nedproductions.biz X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from [192.168.2.8] (dsl-076-041.cust.imagine.ie [87.232.76.41]) by europe2.nedproductions.biz (Postfix) with ESMTPSA id D1BB79EE241; Tue, 20 Dec 2011 09:48:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nedprod.com; s=mail; t=1324374491; bh=Rs69jaibQ1OZrqifUeiHb8XS3MKtN3hE9gJpzqpcTAs=; h=From:To:Date:MIME-Version:Subject:Message-ID:In-reply-to: References:Content-type:Content-transfer-encoding: Content-description; b=cqlLV1ms0cUCUb7Z55qjpCBgLX49PjznSPpehdzZRZM1IF8aiCfBsUjvJ5d1zn1bF 2x66nnKdCFnDYFFXq7b/T4+dm+aPutTrlSNHP/6gvAmOuC8P5Fc+GaQXmmwUQjv2/7 bnSUYEIMv+PXpXf07UIOUpISvMr+ltD2hPRyYU+8= From: "Niall Douglas" To: threads@freebsd.org, arch@freebsd.org Date: Tue, 20 Dec 2011 09:48:12 -0000 MIME-Version: 1.0 Message-ID: <4EF059DC.26433.B55D8036@s_sourceforge.nedprod.com> Priority: normal In-reply-to: References: <20111216214913.GA1771@hoeg.nl>, <4EEF9235.31023.B2519C9A@s_sourceforge.nedprod.com>, X-mailer: Pegasus Mail for Windows (4.62) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Cc: 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: Tue, 20 Dec 2011 09:48:13 -0000 On 19 Dec 2011 at 17:31, Daniel Eischen wrote: > > Obviously, had we known that from the beginning, things would have > > been done differently. However, there was - in hindsight - a lack of > > realisation just how expensive any significant changes would appear > > to vendors. > > And why on earth would the thought of having a threading API > significantly different from the POSIX API even be on the > table? It boggles the mind. 1. Because POSIX threads is known to have weaknesses in its design e.g. signal handling. These BTW have been fixed in C1X and there are some significant departures from the POSIX API wherever pthreads was just plain broke. Some of these departures may - on some platforms - require rejigging the internal kernel/userspace boundary. Before you ask, no I don't know what these are, it isn't my area of expertise. 2. Because pthreads were designed a long time ago in a world where threading was simpler and likely core count was lower. There are more use models now, and originally it was thought that incorporating some elements of newer threading models would be wise. Bear in mind that C1X - unlike POSIX - has to incorporate EVERY kind of computing system thinkable. C1X needs to run - without major baggage - on everything from tiny, OSless systems right up to thousand CPU core highly proprietary systems. And it must do this while staying as backward compatible with legacy systems as possible. 3. Because pthreads is not the only major threading implementation out there. The NT/OS/2 model is hugely popular if fundamentally anti-scalable in design and pthreads don't map exactly one to one with them. For example, thread cancellation is completely missing from C1X as it would require significant kernel rewriting on NT, so it got chopped completely. It had been hoped we could come up with something which worked around the lack of thread cancellation, but we didn't make it in time. It'll be TR1 before we nail the corner cases. Right now, there are quite a few places where under the C1X API the program will just hang if things go wrong and there is no legal way out at all. That is unfortunate, but as always it's a question of resourcing and time. Most people's employers don't see how investing in standards work improves their bottom line, so a lot of the grunt work is goodwill and hobby time. 4. Because POSIX does evolve over time - indeed, its next release is same year as C1X (i.e. next year). People sit on both ISO committees and are on the Austin Working Group. There is significant cross-pollination. The changes in C1X are highly likely to become normalised in the next iteration of POSIX. So think of this way, the departures from POSIX in C1X were mostly intended as departures by POSIX from POSIX next iteration anyway. Niall -- Technology & Consulting Services - ned Productions Limited. http://www.nedproductions.biz/. VAT reg: IE 9708311Q. Company no: 472909.