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 ACC5D5A6E for ; Fri, 5 May 2017 04:32:00 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.38,290,1491238800"; d="scan'208,217";a="34021387" Received: from 125.235.240.45.adsl.viettel.vn (HELO mta2.viettel.com.vn) ([125.235.240.45]) by mailfilter03.viettel.com.vn with ESMTP; 05 May 2017 09:31:58 +0700 Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id 05BA9681EB0 for ; Fri, 5 May 2017 09:32:25 +0700 (ICT) Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id CvV8TLHxTZ4r for ; Fri, 5 May 2017 09:32:24 +0700 (ICT) Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id DA7EC681E88 for ; Fri, 5 May 2017 09:32:24 +0700 (ICT) X-Virus-Scanned: amavisd-new at Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nuzAM-MBPQGZ for ; Fri, 5 May 2017 09:32:24 +0700 (ICT) Received: from vuonglv.vttek (unknown [203.113.138.20]) by mta2.viettel.com.vn (Postfix) with ESMTPSA id 8D4B1681E01 for ; Fri, 5 May 2017 09:32:24 +0700 (ICT) To: users@dpdk.org Message-ID: 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:32:24 +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-users] How to using add/lookup hash table in multithread environment X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 02:32:01 -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