I noticed the same and will add that documentation.

-Petri

From: ext Bala Manoharan [mailto:[email protected]]
Sent: Thursday, May 07, 2015 3:49 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 1/3] example: classifier: remove extra local init

Reviewed-by: Balasubramanian Manoharan 
<[email protected]<mailto:[email protected]>>
IMO, we can add additional information in odph_linux_pthread_create() header 
file documentation that this function is expected to call odp_init_local() for 
the thread it creates. Current documentation only says the following

/**
 * Creates and launches pthreads
 *
 * Creates, pins and launches threads to separate CPU's based on the cpumask.
 *
 * @param thread_tbl    Thread table
 * @param mask          CPU mask
 * @param start_routine Thread start function
 * @param arg           Thread argument
 */
void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl,
                               const odp_cpumask_t *mask,
                               void *(*start_routine) (void *), void *arg);
Regards,
Bala

On 7 May 2015 at 17:04, Petri Savolainen 
<[email protected]<mailto:[email protected]>> wrote:
Worker threads are created with odph_linux_pthread_create()
which calls odp_local_init() before entering the function.

Signed-off-by: Petri Savolainen 
<[email protected]<mailto:[email protected]>>
---
 example/classifier/odp_classifier.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index d78eb7b..35d9684 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -249,13 +249,6 @@ static void *pktio_receive_thread(void *arg)
        appl_args_t *appl = (appl_args_t *)arg;
        global_statistics *stats;

-
-       /* Init this thread */
-       if (odp_init_local()) {
-               EXAMPLE_ERR("ODP thread local init failed.\n");
-               exit(EXIT_FAILURE);
-       }
-
        /* Loop packets */
        for (;;) {
                odp_pktio_t pktio_tmp;
--
2.4.0

_______________________________________________
lng-odp mailing list
[email protected]<mailto:[email protected]>
https://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to