DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "vuonglv@viettel.com.vn" <vuonglv@viettel.com.vn>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] How to using add/lookup hash table in multithread	environment
Date: Tue, 9 May 2017 16:48:33 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912652799010@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <874b0c85-f02e-1fb9-c648-1f0570d92db2@viettel.com.vn>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
> vuonglv@viettel.com.vn
> Sent: Friday, May 5, 2017 5:52 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] How to using add/lookup hash table in multithread
> environment
> 
> 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?
> 
> 

You could use a single thread to do the table add/del (table manager thread); when other threads need to do add/del, have them send a request to the table manager.

> Many thanks,
> Vuong Le

  reply	other threads:[~2017-05-09 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  2:51 vuonglv
2017-05-09 16:48 ` Dumitrescu, Cristian [this message]
2017-05-09 16:49 ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EB4FA525960D640B5BDFFD6A3D8912652799010@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=vuonglv@viettel.com.vn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).