From: Petri Savolainen <petri.savolai...@nokia.com>

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 <petri.savolai...@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
---
 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);
+
+
+/**
  * @}
  */
 
-- 
1.9.1

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to