Re: KITTEN: IETF 75 - 76

Michael B Allen <miallen@ioplex.com> Wed, 02 September 2009 21:24 UTC

Return-Path: <miallen@ioplex.com>
X-Original-To: kitten@core3.amsl.com
Delivered-To: kitten@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id A1A3E3A6AE1 for <kitten@core3.amsl.com>; Wed, 2 Sep 2009 14:24:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.162
X-Spam-Level:
X-Spam-Status: No, score=-2.162 tagged_above=-999 required=5 tests=[AWL=0.438, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1f0DoJ5yqtYv for <kitten@core3.amsl.com>; Wed, 2 Sep 2009 14:24:53 -0700 (PDT)
Received: from mail.ioplex.com (li31-113.members.linode.com [207.192.69.113]) by core3.amsl.com (Postfix) with ESMTP id 7FFB93A70FA for <kitten@ietf.org>; Wed, 2 Sep 2009 14:21:27 -0700 (PDT)
Received: from proton.foo.net (pool-71-187-189-103.nwrknj.fios.verizon.net [71.187.189.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: miallen) by mail.ioplex.com (Postfix) with ESMTP id 89044411DC; Wed, 2 Sep 2009 17:20:15 -0400 (EDT)
Date: Wed, 02 Sep 2009 17:20:15 -0400
From: Michael B Allen <miallen@ioplex.com>
To: Nicolas Williams <Nicolas.Williams@sun.com>
Subject: Re: KITTEN: IETF 75 - 76
Message-Id: <20090902172015.da056c19.miallen@ioplex.com>
In-Reply-To: <20090902153241.GJ1033@Sun.COM>
References: <4A87A69A.3050408@sun.com> <4A87E02D.7030503@isode.com> <200908180013.29152.leifj@mnt.se> <20090901131202.137bdd90.miallen@ioplex.com> <20090901173110.GL1033@Sun.COM> <396484EF-9812-40CE-9221-F1A1319FD10B@kth.se> <20090901181307.fe1d4efa.miallen@ioplex.com> <98F14484-1B48-45A1-86E7-5E78383F5109@kth.se> <20090901214059.17a309e6.miallen@ioplex.com> <4A9E22D9.9050405@samba.org> <20090902153241.GJ1033@Sun.COM>
Organization: IOPLEX Software
X-Mailer: Sylpheed 2.6.0 (GTK+ 2.12.12; i386-redhat-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Cc: "kitten@ietf.org" <kitten@ietf.org>, Love, Volker Lendecke <vl@SerNet.DE>
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/kitten>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Sep 2009 21:24:54 -0000

On Wed, 2 Sep 2009 10:32:41 -0500
Nicolas Williams <Nicolas.Williams@sun.com> wrote:
> Absolutely no polling.
> 
> Async I/O is not rocket science.  We can quibble over details, but we've
> only got so many workable models.  And we have to be mindful that not
> one model will result in fully portable application code.
> 
> Here are some reasonable models:
> 
>  - Completion callback (or, rather, a callback indicating that there's
>    work to do, not necessarily completion)
> 
>    This implies either a threaded process model or an async I/O process
>    model with one common event loop provided by the OS.
> 
>    This model is the simplest for apps to use, and it will be portable
>    to Linux, *BSD, Solaris, Windows.  But not necessarily to embedded
>    devices, real-time OSes, etc...
> 
>  - Return handles to I/O resources that the app can feed into its event
>    loop.
> 
>    This is much more OS-specific.  On Unix/Unix-like OSes this means
>    returning an array of file descriptors.  On Windows it means
>    returning and array of file handles.  This too may not be terribly
>    portable.  And it requires that the application plug the returned
>    resources into its event loop, and take them out, on every call to
>    these GSS functions.

There is another model:

> > while (1) {
        gss_process_events(&minor, ...);
> > 
> > 	ret = gss_call(&minor, GSS_C_NOWAIT, ...);
> > 	if (ret != 0 && minor == EAGAIN) {
> > 		continue;
> > 	}
> > 	...
> > 	break;
> > }

The gss_process_events function would power the mechanism's event loop and wait for the status of an operation to change. Basically it would just call an implementation specific event loop without the 'loop'.

So there is no callback, it is not polling and it would be portable to pretty much any system because it does not require multiple threads / processes. You could juggle many GSS contexts with a single thread / process without breaking a sweat.

Note that I'm not necessarily advocating this technique. Currently I actually do something quite different for event loop stuff which seems to be the use-case we're talking about. There might be some horrendous flaw with it but I can't think of one at the moment.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/