Re: GSS-APIv3 sketch

Nicolas Williams <> Thu, 12 November 2009 17:22 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 71DB83A6BB4 for <>; Thu, 12 Nov 2009 09:22:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.027
X-Spam-Status: No, score=-6.027 tagged_above=-999 required=5 tests=[AWL=0.019, BAYES_00=-2.599, HELO_MISMATCH_COM=0.553, RCVD_IN_DNSWL_MED=-4]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id YWt2FqtJMzWK for <>; Thu, 12 Nov 2009 09:22:43 -0800 (PST)
Received: from (brmea-mail-4.Sun.COM []) by (Postfix) with ESMTP id 414903A6AF2 for <>; Thu, 12 Nov 2009 09:22:43 -0800 (PST)
Received: from ([]) by (8.13.6+Sun/8.12.9) with ESMTP id nACHNB8m027622 for <>; Thu, 12 Nov 2009 17:23:11 GMT
Received: from binky.Central.Sun.COM (binky.Central.Sun.COM []) by (8.13.8+Sun/8.13.8/ENSMAIL, v2.2) with ESMTP id nACHNAfj015765 for <>; Thu, 12 Nov 2009 10:23:10 -0700 (MST)
Received: from binky.Central.Sun.COM (localhost []) by binky.Central.Sun.COM (8.14.3+Sun/8.14.3) with ESMTP id nACH44u4015015; Thu, 12 Nov 2009 11:04:04 -0600 (CST)
Received: (from nw141292@localhost) by binky.Central.Sun.COM (8.14.3+Sun/8.14.3/Submit) id nACH43Bl015014; Thu, 12 Nov 2009 11:04:03 -0600 (CST)
X-Authentication-Warning: binky.Central.Sun.COM: nw141292 set sender to using -f
Date: Thu, 12 Nov 2009 11:04:03 -0600
From: Nicolas Williams <>
To: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Subject: Re: GSS-APIv3 sketch
Message-ID: <20091112170403.GB1105@Sun.COM>
References: <20091111181140.GC10501@Sun.COM> <> <20091111184244.GN1105@Sun.COM> <20091111184726.GD10501@Sun.COM> <> <E1N8MHF-004jYm-T7@intern.SerNet.DE> <20091111230442.GY1105@Sun.COM> <E1N8Twh-0057MW-SY@intern.SerNet.DE>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <E1N8Twh-0057MW-SY@intern.SerNet.DE>
User-Agent: Mutt/1.5.7i
Cc: "" <>, Love Hörnquist Åstrand <>
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 12 Nov 2009 17:22:44 -0000

On Thu, Nov 12, 2009 at 08:20:18AM +0100, Volker Lendecke wrote:
> On Wed, Nov 11, 2009 at 05:04:42PM -0600, Nicolas Williams wrote:
> > I'd like to hear more about this.  Can you please describe the problem
> > with libraries creating worker threads?  You can use private e-mail if
> > you wish.  References to bug reports would be great.
> The most nasty implications come from initialization and
> from fork. If you have several libraries doing threads, it
> is easy for unsuspecting applications creating races. The
> worst one is fork: You have to shut down all threads before
> the fork and potentially re-start them after it, because you
> need to drop all locks/mutexes/etc during the fork. If
> needed, I can try to contact the author and get his slides

I'd love to see that, please :)

OpenSolaris' fork() == fork1(), and it has forkx(2) for libraries.
forkx(2) allows library-forked child procs to not interfere with the
application running in the parent, e.g., by not triggering SIGCHLD and
not showing up in plain wait(3C) calls.  And libraries in OpenSolaris
that create worker threads take care to use pthread_atfork() and
atexit() handlers to do fork/exit cleanup.

Of course, pthread_atfork() and atexit() are standard functions...
Libraries on Linux should use them too.

If there are issues in OpenSolaris (apologies to the list) about this, I
really want to hear about them, because we need to make sure they are
addressed if it's at all possible.  I also care to hear about issues on
Linux and *BSD though (I do some development on Linux, but mostly I want
to be informed).