From patchwork Thu May 19 09:56:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68113 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3078228qge; Thu, 19 May 2016 02:02:13 -0700 (PDT) X-Received: by 10.140.232.137 with SMTP id d131mr13233855qhc.87.1463648533394; Thu, 19 May 2016 02:02:13 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d88si11413096qgf.38.2016.05.19.02.02.12; Thu, 19 May 2016 02:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B850D6161C; Thu, 19 May 2016 09:02:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A5DC0610AC; Thu, 19 May 2016 09:02:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 084E361071; Thu, 19 May 2016 09:01:58 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id 5951761071 for ; Thu, 19 May 2016 08:58:04 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id y84so32149065lfc.0 for ; Thu, 19 May 2016 01:58:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZQUj0wab/MxCJpGQL7HuyedKxKyceZPSHY2q9ZN16JU=; b=TC65q+y2Nk5EU8YyqZeCaAC7NmIxGXvj1vd43L39CssNiUN//3eOQ/lBMCH+suSYJN YlRmpd2b2v6tWazou/1UqvhVmkbhiZ4Eho2MUKEEOimQoWFePZRrQV7YTQGXgy0YhWBb uzbMaiCJcCR1qR9JYPEVeaMyzC+ggNuqC/hVJdU99aLNuYSf5wqcw0+5lFS4tdfmOoA9 wn8JXJxCiiTR9idysnxaY607+Noh3z95mAo1u3tmrsI2xaJCzbdbU+nYH9W630W21jGy 3wIY8oOCsKidd1z6u3jbpjIYVQnLWxL7jZIvkltV8Vg2xl9dZdmBmmM4tfE3X6Yibl/S sKWg== X-Gm-Message-State: AOPr4FU5qpwdPeznfIH/Lppzhs1kAbH09rxfoSJDwPb4k+Bk5CgrRm7J3mJnXYYssivaVy70MxY= X-Received: by 10.25.90.79 with SMTP id o76mr4112589lfb.67.1463648283221; Thu, 19 May 2016 01:58:03 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id wc3sm83723lbb.27.2016.05.19.01.58.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 01:58:02 -0700 (PDT) From: Christophe Milard To: bill.fischofer@linaro.org, mike.holmes@linaro.org, petri.savolainen@nokia.com, lng-odp@lists.linaro.org Date: Thu, 19 May 2016 11:56:35 +0200 Message-Id: <1463651795-62030-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [PATCH] doc: proper definition of ODP thread X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Making clear which ODP instance a thread is joining when calling odp_init_local(). Signed-off-by: Christophe Milard --- doc/glossary.adoc | 22 +++++++++++++++------- include/odp/api/spec/init.h | 3 +++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/glossary.adoc b/doc/glossary.adoc index 2c0de24..8d77f24 100644 --- a/doc/glossary.adoc +++ b/doc/glossary.adoc @@ -10,7 +10,8 @@ control thread:: operating system house keeping tasks but will be scheduled by it and may receive interrupts. ODP instantiation process:: - The process calling `odp_init_global()`, which is probably the + The OS "flow of execution" (i.e. OS process or OS thread) + calling `odp_init_global()`, which is probably the first process which is started when an ODP application is started. There is one single such process per ODP instantiation. thread:: @@ -19,12 +20,19 @@ thread:: ODP thread:: An ODP thread is a flow of execution that belongs to ODP: Any "flow of execution" (i.e. OS process or OS thread) calling - `odp_init_global()`, or `odp_init_local()` becomes an ODP thread. - This definition currently limits the number of ODP instances on a given - machine to one. In the future `odp_init_global()` will return something - like an ODP instance reference and `odp_init_local()` will take such - a reference in parameter, allowing threads to join any running ODP instance. - Note that, in a Linux environment an ODP thread can be either a Linux + `odp_init_local()` becomes an ODP thread. + On OSes supporting process hierarchy (e.g. linux), any "flow of execution" + calling `odp_init_local()` becomes an ODP thread of the ODP instance whose + ODP instantiation process is an ancestor of (or same as) this + "flow of execution". + This means that on these OSes, all ODP threads are descendant of (or + same as) their ODP instantiation process. + This also means that on these OSes, the ODP instance passed as + `odp_init_local()` parameter is ignored. + This parameter is only meaningful on OSes which do not support process + hierarchy. It is nevertheless recommended to set the value of this + parameter correctly in all cases for portability. + Note that, e.g. in a Linux environment an ODP thread can be either a Linux process or a linux thread (i.e. a linux process calling `odp_init_local()` will be referred as ODP thread, not ODP process). event:: diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index fec6774..343735e 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -234,6 +234,9 @@ int odp_term_global(odp_instance_t instance); * All threads must call this function before calling any other ODP API * functions. The instance parameter specifies which ODP instance the thread * joins. A thread may be simultaneously part of single ODP instance only. + * On OSes supporting process hierarchy (e.g linux), this parameter is actually + * ignored as all ODP threads have to be descendant of their ODP + * instantiation process. * * @param instance Instance handle * @param thr_type Thread type