From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailfilter03.viettel.com.vn (mailfilter03.viettel.com.vn [125.235.240.55]) by dpdk.org (Postfix) with ESMTP id 2ABF2330D for ; Fri, 5 May 2017 04:54:13 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.38,290,1491238800"; d="scan'208,217";a="34027821" Received: from 125.235.240.44.adsl.viettel.vn (HELO mta1.viettel.com.vn) ([125.235.240.44]) by mailfilter03.viettel.com.vn with ESMTP; 05 May 2017 09:54:00 +0700 Received: from localhost (localhost [127.0.0.1]) by mta1.viettel.com.vn (Postfix) with ESMTP id E14F160A08C for ; Fri, 5 May 2017 09:51:58 +0700 (ICT) Received: from mta1.viettel.com.vn ([127.0.0.1]) by localhost (mta1.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id mM8qSpZbk0Zt for ; Fri, 5 May 2017 09:51:58 +0700 (ICT) Received: from localhost (localhost [127.0.0.1]) by mta1.viettel.com.vn (Postfix) with ESMTP id C1C3860A022 for ; Fri, 5 May 2017 09:51:58 +0700 (ICT) X-Virus-Scanned: amavisd-new at Received: from mta1.viettel.com.vn ([127.0.0.1]) by localhost (mta1.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hXVnIl3AaASI for ; Fri, 5 May 2017 09:51:58 +0700 (ICT) Received: from vuonglv.vttek (unknown [203.113.138.20]) by mta1.viettel.com.vn (Postfix) with ESMTPSA id 91D06609FAE for ; Fri, 5 May 2017 09:51:58 +0700 (ICT) To: dev@dpdk.org Message-ID: <874b0c85-f02e-1fb9-c648-1f0570d92db2@viettel.com.vn> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 MilterAction: FORWARD Date: Fri, 5 May 2017 09:51:58 +0700 (ICT) From: vuonglv@viettel.com.vn Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] How to using add/lookup hash table in multithread environment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 02:54:14 -0000 Hi DPDK team, I am using DPDK to build a program in multithread environment. I use 1 thread (on 1 core) to add and delete hash table key ( by rte_hash_add_key() and rte_hash_del_key() function); And use 8 thread (on 8 others core) to lookup (by rte_hash_lookup() function ). As I know, rte_hash_lookup() function is /multi-thread safe,/ and te_hash_add_key() and rte_hash_del_key() function is not /multi-thread safe/. So: Do I need using /lock/ when I add or delete key by 1 thread while 8 others thread is looking-up? Many thanks, Vuong Le