From patchwork Thu Jul 9 13:46:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 50958 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0985D228E5 for ; Thu, 9 Jul 2015 13:47:19 +0000 (UTC) Received: by wgbbj7 with SMTP id bj7sf79601362wgb.2 for ; Thu, 09 Jul 2015 06:47:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=MtqpyFUtDcxKJI3kQOVnpkPYRjJcGNHMftkpde9zo/Q=; b=IB9nU5EQfbAN2AOm5C9At1DUB5oNkMxL8eMPUAtMU3Vq6fjCsH+WW82lgJ/2KSkKBN XQ0z8X7JjIGRQL6TOpCp57dy9cvI6HPH9peyJx5sqK37n87SyPyRY+BsANxDbb8zgC/4 SQlJoTSOVDzbm3Mld+sy6Rb7Nu3LTN0ylVlAv8GNManzDhYcxSmFfRJSKidmiTKg5CwY g6iiWaz2CBGG4fetKDqtKu7JoLeBrl9OUix/KrdTD5W5zFwMK3xIrWTQB2cP+/LpGADD 7BrFJdSVZR2y3PEO1NaidFQ6zdpjYKzI0b5fgWIW/mEaX15vpJHzUedPRIWNfPT019cR cD5Q== X-Gm-Message-State: ALoCoQnxLjv5pniB48yNDOv70th0f/4bkpCLcSOHPxlJeWrLkKsWepHCUC/wSS1HePISfgF3EYp0 X-Received: by 10.112.255.66 with SMTP id ao2mr7887133lbd.15.1436449638253; Thu, 09 Jul 2015 06:47:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls1087030laj.72.gmail; Thu, 09 Jul 2015 06:47:18 -0700 (PDT) X-Received: by 10.152.116.39 with SMTP id jt7mr14830170lab.82.1436449637972; Thu, 09 Jul 2015 06:47:17 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id xs2si4523880lac.134.2015.07.09.06.47.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 06:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbzd8 with SMTP id d8so30086040lbz.0 for ; Thu, 09 Jul 2015 06:47:17 -0700 (PDT) X-Received: by 10.152.88.77 with SMTP id be13mr14728413lab.112.1436449637868; Thu, 09 Jul 2015 06:47:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp680658lbb; Thu, 9 Jul 2015 06:47:17 -0700 (PDT) X-Received: by 10.55.22.167 with SMTP id 39mr25023349qkw.42.1436449636569; Thu, 09 Jul 2015 06:47:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b129si6600253qhc.109.2015.07.09.06.47.15; Thu, 09 Jul 2015 06:47:16 -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; Received: by lists.linaro.org (Postfix, from userid 109) id AD66361FDA; Thu, 9 Jul 2015 13:47:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 9825161FC9; Thu, 9 Jul 2015 13:46:41 +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 6B78F61F9E; Thu, 9 Jul 2015 13:46:36 +0000 (UTC) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by lists.linaro.org (Postfix) with ESMTPS id 48D1061D30 for ; Thu, 9 Jul 2015 13:46:35 +0000 (UTC) Received: by wgjx7 with SMTP id x7so223893621wgj.2 for ; Thu, 09 Jul 2015 06:46:34 -0700 (PDT) X-Received: by 10.180.91.76 with SMTP id cc12mr127283048wib.67.1436449594534; Thu, 09 Jul 2015 06:46:34 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id df1sm8414627wib.12.2015.07.09.06.46.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 06:46:33 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 9 Jul 2015 16:46:15 +0300 Message-Id: <1436449585-23252-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> References: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Cc: Petri Savolainen Subject: [lng-odp] [PATCH 01/11] api: thread: added thread type X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Petri Savolainen Two thread types are defined: worker and control threads. API calls from a worker thread should be throughput and latency optimized, while the second one is not so sensitive to call overheads and latency. Signed-off-by: Petri Savolainen Signed-off-by: Maxim Uvarov --- include/odp/api/thread.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index a509ef9..89eae2b 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -23,6 +23,34 @@ extern "C" { */ /** + * Thread type + */ +typedef enum odp_thread_type_e { + /** + * Worker thread + * + * Worker threads do most part of ODP application packet processing. + * These threads provide high packet and data rates, with low and + * predictable latency. Typically, worker threads are pinned to isolated + * CPUs and packets are processed in a run-to-completion loop with very + * low interference from the operating system. + */ + ODP_THREAD_WORKER = 0, + + /** + * Control thread + * + * Control threads do not participate the main packet flow through the + * system, but e.g. control or monitor the worker threads, or handle + * exceptions. These threads may perform general purpose processing, + * use system calls, share the CPU with other threads and be interrupt + * driven. + */ + ODP_THREAD_CONTROL +} odp_thread_type_t; + + +/** * Get thread identifier * * Returns the thread identifier of the current thread. Thread ids range from 0 @@ -47,6 +75,16 @@ int odp_thread_id(void); int odp_thread_count(void); /** + * Thread type + * + * Returns the thread type of the current thread. + * + * @return Thread type + */ +odp_thread_type_t odp_thread_type(void); + + +/** * @} */