[Anima-signaling] GRASP API issue 1: non-threaded ASAs

Brian E Carpenter <brian.e.carpenter@gmail.com> Sun, 08 January 2017 01:16 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: anima-signaling@ietfa.amsl.com
Delivered-To: anima-signaling@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C79A312968E; Sat, 7 Jan 2017 17:16:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1zKK0eAXyLuP; Sat, 7 Jan 2017 17:16:32 -0800 (PST)
Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3E78C12964F; Sat, 7 Jan 2017 17:16:32 -0800 (PST)
Received: by mail-pg0-x241.google.com with SMTP id 75so9657033pgf.3; Sat, 07 Jan 2017 17:16:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:organization:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=8cwoGZShzqRFTOABjDjJus+TGH9Y+/Oslk9FwzYlPik=; b=LFSez1HbJWcMpNWE42MLFF/tnuNJmLpAeG4GM5cpEhmiqKeOuIB4amUy6/do++6mod i+Qiyvd3FQsYNE3FsCuc7hxB4VKLYv705ii8YUq47R2aOKz+fuwk0HHonOY6EebSNx+8 JNpiOMAX9i9P5uhlWkOPP725fnv70BANNNCmOxDxmLwYH/1Em8pLnWvglzn/d/dTybTH 2TWjWbmGGvFGL7+/EiCohGfBgSOmNSVc3Lti4VhrLNvpKY2KW0VVEjASNYY+fAoZtDsO qX6dIRoCNz7/F0csu+aw5AxZn6ftyASzPVzto9Tp8TYK9QvAfhXhu9H0r2W2X5Cz/sQW EBUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:organization:cc:message-id:date :user-agent:mime-version:content-transfer-encoding; bh=8cwoGZShzqRFTOABjDjJus+TGH9Y+/Oslk9FwzYlPik=; b=YQAbB0en9XOzJc8PSy/1VBmhMisK7Lhu7ea7bPfPiI11kZJIQ4APh9yz+DxNOsl7gU 9Dar3W2zPvIDqRzOEztkS+8h/jbr6UzXvcZzdAbSElpaCj2jGFGtIZMiJp+QGFX2xF+H QjT11gtEbp7pjbs8MzH3V7kVONnG4lrs15SAeaHBC3J4ved2BvtlMOO90dMY2wa3Zgbb dbaCBE8FEfVcFaXCyGmeCB0aPGxZTSV1+Z2K0Wa2CFjqzs8NYtQbBWZjCxEVHuu+WOu9 9yT2gIbHl0/6rxqduYY77l32CZ0zsRgHzD9B/cojtKWvkgEhsCRc788gWp5ANa7kivkJ XkLg==
X-Gm-Message-State: AIkVDXK0fpz+g4R+GgU6ih/lIrW3IBuzaSD4o7kdUveKURZC45V5g10QpT/HPOHDlGSzHA==
X-Received: by 10.98.160.79 with SMTP id r76mr17599795pfe.154.1483838191593; Sat, 07 Jan 2017 17:16:31 -0800 (PST)
Received: from [192.168.178.21] ([118.149.104.180]) by smtp.gmail.com with ESMTPSA id p68sm168414455pfd.11.2017.01.07.17.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2017 17:16:30 -0800 (PST)
To: Anima signaling DT <anima-signaling@ietf.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <66f4d2f6-d22a-edd7-5514-0482aaf48277@gmail.com>
Date: Sun, 8 Jan 2017 14:16:22 +1300
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima-signaling/7DpRwaXa7aeSOcqR8T0Drqv_dzs>
Cc: draft-liu-anima-grasp-api@ietf.org
Subject: [Anima-signaling] GRASP API issue 1: non-threaded ASAs
X-BeenThere: anima-signaling@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Mailing list for the signaling design team of the ANIMA WG <anima-signaling.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima-signaling/>
List-Post: <mailto:anima-signaling@ietf.org>
List-Help: <mailto:anima-signaling-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Jan 2017 01:16:34 -0000

Hi,

While investigating a C representation of the GRASP API, we have
hit this question: What if there is no real multithreading support
in the language/operating system used to write an ASA?

A typical way to solve that problem is to use an event-loop or polling
style of implementation - which basically requires the GRASP function
calls to be non-blocking.

There are 5 API calls that work well in a multi-threaded solution but
would cause problems in an event-loop solution:

discover()
request_negotiate()
negotiate_step()
synchronize()

  These may wait until a timeout expires.

listen_negotiate()

  This blocks until an incoming request_negotiate() arrives.

A possible solution is to provide non-blocking versions of each of
this, which return immediately with a return code meaning "not yet"
until they have a result (or a timeout). A threaded implementation
would use the normal, blocking versions; an event-loop implementation
would use the non-blocking versions.

Comments? Other suggestions?

   Brian